Little README update
This commit is contained in:
@@ -22,7 +22,7 @@ python -m pip install git+https://git.tyukalov.su/nikita/mab@v0.4.0
|
|||||||
```
|
```
|
||||||
|
|
||||||
You should specify package version you want to use, because `main` without tags
|
You should specify package version you want to use, because `main` without tags
|
||||||
contain unstable code.
|
contains unstable code.
|
||||||
|
|
||||||
## Basic usage
|
## Basic usage
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ from mab.types import RoomEventData
|
|||||||
|
|
||||||
async def on_message(data: RoomEventData) -> None:
|
async def on_message(data: RoomEventData) -> None:
|
||||||
text = f"Your message contains {len(data.event.body)} symbols"
|
text = f"Your message contains {len(data.event.body)} symbols"
|
||||||
await data.bot.send_text_to_room(data.room, text)
|
await data.bot.send_text(data.room, text)
|
||||||
|
|
||||||
async def main() -> None:
|
async def main() -> None:
|
||||||
# create and start the bot
|
# create and start the bot
|
||||||
@@ -49,7 +49,7 @@ async def main() -> None:
|
|||||||
)
|
)
|
||||||
bot = MatrixBot(matrix_bot_config)
|
bot = MatrixBot(matrix_bot_config)
|
||||||
bot.add_callback(
|
bot.add_callback(
|
||||||
~SenderIsBotFilter() & TextContainsFilter(["test", "hello", "hi"]),
|
~SenderIsBotFilter() & TextContainsFilter(["hello", "hi"]),
|
||||||
on_message
|
on_message
|
||||||
)
|
)
|
||||||
await bot.start()
|
await bot.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user