]> jfr.im git - erebus.git/commit
add `bot.reply` function and hook return shortcut
authorzonidjan <redacted>
Sun, 12 Aug 2018 09:31:05 +0000 (04:31 -0500)
committerzonidjan <redacted>
Sun, 12 Aug 2018 09:31:05 +0000 (04:31 -0500)
commitd6052ebf5c79ddac9cc0c71cd78ac1701eeaabcc
tree66f529ce0227c1b52185629bc6481fa0a914cf4c
parentb8fdeddf42441b793ac49aa9b9949c1918e508bd
add `bot.reply` function and hook return shortcut

bot.reply(chan, user, reply_msg) will now send a reply.
This is meant to be used directly with the chan and user objects passed to a hook.
This is bot.msg(user, reply_msg) when chan is None (i.e. when used via PM or when wantchan=False);
or bot.msg(chan, "user: reply_msg") when chan is not None (i.e. when used in channel or via PM with wantchan=True and channel provided)

Returning a string (Py2: str or unicode) from a hook will now result in a bot.reply.
bot.py