mirror of
https://github.com/maubot/maubot
synced 2025-08-30 05:20:38 +00:00
Update hello world example and add config example
This commit is contained in:
parent
400c9aaebc
commit
ac69c50b80
8 changed files with 49 additions and 10 deletions
|
@ -1,14 +0,0 @@
|
|||
from maubot import Plugin, MessageEvent
|
||||
from mautrix.types import EventType
|
||||
|
||||
|
||||
class HelloWorldBot(Plugin):
|
||||
async def start(self) -> None:
|
||||
self.client.add_event_handler(self.handler, EventType.ROOM_MESSAGE)
|
||||
|
||||
async def stop(self) -> None:
|
||||
self.client.remove_event_handler(self.handler, EventType.ROOM_MESSAGE)
|
||||
|
||||
async def handler(self, event: MessageEvent) -> None:
|
||||
if event.sender != self.client.mxid:
|
||||
await event.reply("Hello, World!")
|
Loading…
Add table
Add a link
Reference in a new issue