Skip to content

Commit

Permalink
Merge pull request #25 from yuma-m/master
Browse files Browse the repository at this point in the history
Update example in README.md
  • Loading branch information
yupix authored Aug 17, 2023
2 parents a139090 + 169fe87 commit 901a849
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ class MyBot(Bot):
def __init__(self):
super().__init__()

async def _connect_channel(self):
await self.router.connect_channel(['main', 'home'])

async def on_ready(self, ws: ClientWebSocketResponse):
await self.router.connect_channel(['main', 'home'])
await self._connect_channel()
print('Logged in ', self.user.username)

async def on_reconnect(self, ws: ClientWebSocketResponse):
await self._connect_channel()

async def on_note(self, note: Note):
print(note.author.username, note.content)

Expand Down

0 comments on commit 901a849

Please sign in to comment.