import random from ekimbot.botplugin import ClientPlugin, CommandHandler class SeagullCommand(ClientPlugin): name = 'seagull' @CommandHandler('seagull', 0) def reverse(self, msg, *args): out = "{" depth = 1 while depth: c = '{' if random.random() * 20 > len(out) else '}' if c == '{': depth += 1 else: depth -= 1 out += c self.reply(msg, out)