import brathuhn # -*- coding: utf-8 -*- TEXT=u"ABCDEFGHIJKLMOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" text=u"zʎxʍʌnʇsɹbdouɯlʞɾᴉɥƃɟǝpɔqɐZ⅄XMΛ∩┴SɹQԀOW˥ʞſIHפℲƎpƆq∀"[::-1] assert(len(TEXT)==len(text)) upside_down = {} for i in xrange(len(TEXT)): T,t = TEXT[i],text[i] upside_down[T]=t def turn(s): ret = u"" for c in s: if c in upside_down: ret = upside_down[c] + ret else: ret = " " + ret return ret def upside_down_func(msg,args): if len(args)!=2: brathuhn.sendMsg(brathuhn.ROOM,"Usage: "+args[0]+" text",'groupchat') brathuhn.sendMsg(brathuhn.ROOM, turn(args[1]) ,'groupchat') brathuhn.addCommand("upsidedown","Usage: !upsidedown text",upside_down_func)