def paizuri(prefix, channel, message, cache=collections.defaultdict(lambda: 1)): ban_time = cache[prefix.nick] cache[prefix.nick] *= 2 yield cc.mode(channel, '+b', prefix) yield cc.kick(channel, prefix.nick, message='Banned for {0} second{1}!'.format(ban_time, 's' if ban_time > 1 else '')) yield from asyncio.sleep(ban_time) yield cc.mode(channel, '-b', prefix) yield cc.invite(prefix.nick, channel)
def kick(prefix, channel, message): return cc.kick(channel, prefix.nick=message[i+1], message='Go away!') for i in range(len(message)-1)
def belly2(prefix, channel, message): return cc.kick(channel, prefix.nick, message='{0.nick} no ecchi!'.format(prefix))