url = message.attachments[0]['url']
if url is None:
log.debug('No URL for avatar')
- yield from bot.say(message.channel, 'zzz', wake = False)
+ yield from cat.zzz(message.channel)
return
result = yield from set_avatar(url)
if not result:
return
log.debug('Unrecognised command from {}!'.format(message.author.name))
if bot.status() == discord.Status.idle:
- yield from bot.maybe_say(message.channel, 'zzz', wake = False)
+ yield from cat.maybe_zzz(message.channel)
else:
- yield from cat.meow(message.channel)
+ yield from cat.maybe_meow(message.channel)
return True
import bot
@asyncio.coroutine
-def meow(destination, voice = None, **args):
+def maybe_meow(destination, voice = None, **args):
result = False
if destination is not None:
- result = yield from bot.say(destination, 'meow!')
+ result = yield from bot.maybe_say(destination, 'meow!', **args)
if result and voice is not None:
yield from bot.play_sound(voice, 'meow.wav', **args)
@asyncio.coroutine
+def meow(destination, voice = None, **extra):
+ args = {}
+ args.update(**extra)
+ args['probability'] = 1.0
+ yield from maybe_meow(destination, voice, **args)
+
+@asyncio.coroutine
def purr(destination, voice = None, **args):
result = False
if destination is not None:
yield from bot.say(destination, '*shrugs*', **args)
@asyncio.coroutine
-def zzz(destination, **args):
- yield from bot.say(destination, 'zzz', **args)
+def maybe_zzz(destination, **args):
+ yield from bot.maybe_say(destination, 'zzz', **args)
+
+@asyncio.coroutine
+def zzz(destination, **extra):
+ args = {}
+ args.update(**extra)
+ args['probability'] = 1.0
+ args['wake'] = False
+ yield from maybe_zzz(destination, **args)
parsed = self.parse_message(message, name)
if parsed['url'] is None:
log.debug('No URL for avatar to bling.')
- yield from bot.say(message.channel, 'zzz', wake = False)
+ yield from cat.zzz(message.channel)
return
yield from client.send_typing(message.channel)