Refine API for replying

This commit is contained in:
2021-01-10 19:17:10 +01:00
parent 6c2892d5dd
commit 18bae6ec09
6 changed files with 63 additions and 53 deletions

View File

@ -8,9 +8,10 @@ class EchoBot(Bot):
"""
def reply_direct_chat(self, message):
def react(self, message):
"""Send back what we get."""
self.send_direct_chat(to=message.sender, body=message.body)
if message.type == "chat":
self.reply(to=message.sender, body=message.body)
EchoBot()