Add README

This commit is contained in:
Joscha 2019-04-12 00:28:51 +00:00
parent 2bf512d8dc
commit 14b4e74c7e
4 changed files with 93 additions and 78 deletions

29
examples/echobot.py Normal file
View file

@ -0,0 +1,29 @@
import asyncio
import yaboli
class EchoBot(yaboli.Bot):
DEFAULT_NICK = "EchoBot"
HELP_GENERAL = "/me echoes back what you said"
HELP_SPECIFIC = [
"This bot only has one command:",
"!echo <text> reply with exactly <text>",
]
def __init__(self):
super().__init__()
self.register_botrulez()
self.register_general("echo", self.cmd_echo)
async def started(self):
await self.join("test")
async def cmd_echo(self, room, message, args):
await message.reply(args.raw)
async def main():
bot = EchoBot()
await bot.run()
if __name__ == "__main__":
asyncio.run(main())