Start rewrite (yet again)

This will hopefully be the final rewrite.
This commit is contained in:
Joscha 2019-04-06 09:02:09 +00:00
parent 5e108fd31b
commit a5af01f669
19 changed files with 455 additions and 1344 deletions

26
example.py Normal file
View file

@ -0,0 +1,26 @@
import yyb
class MyClient(yyb.Client):
async def on_join(self, room):
await room.say("Hello!")
async def on_message(self, message):
if message.content == "reply to me"):
reply = await message.reply("reply")
await reply.reply("reply to the reply")
await message.room.say("stuff going on")
elif message.content == "hey, join &test!":
# returns room in phase 3, or throws JoinException
room = await self.join("test")
if room:
room.say("hey, I joined!")
else:
message.reply("didn't work :(")
async def before_part(self, room):
await room.say("Goodbye!")
# Something like this, I guess. It's still missing password fields though.
c = MyClient("my:bot:")
c.run("test", "bots")