import random from command_system import as_plugin, RollbotResponse @as_plugin def isadmin(db, message): return RollbotResponse(message, txt=str(message.from_admin)) @as_plugin def debug(db, message): return RollbotResponse(message, txt=str(message)) @as_plugin def echo(db, message): return RollbotResponse(message, txt="'%s' - %s" % (message.raw_args, message.name)) @as_plugin def greet(db, message): return RollbotResponse(message, txt=random.choice(("Hi!", "Hello!", "안녕하세요", "こんにちは", "你好", "👋"))) @as_plugin def console(db, message): argstr = message.raw_args opts = [ "NEVER GIVE UP", "I believe in you!", "You're doing your best, it's okay!" ] if argstr is not None: opts.append("It'll be okay, {}! Keep trying!".format(argstr)) return RollbotResponse(message, txt=random.choice(opts))