Use new attributes

This commit is contained in:
Luke Murphy 2021-01-16 17:39:05 +01:00
parent 42e01862f8
commit cdfa98d47b
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 2 additions and 4 deletions

View File

@ -48,11 +48,9 @@ Here's the code for the `EchoBot`.
```python
class EchoBot(Bot):
def direct(self, message):
self.reply(message.body, to=message.sender)
self.reply(message.text, to=message.sender)
def group(self, message):
if "echobot" in message.body:
self.reply(message.body.split(":")[-1], room=message.room)
self.reply(message.content, room=message.room)
```
Read more in the [API reference](#api-reference) for how to write your own bots.