Ajout fonction dune
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,17 @@ async def repond(room: MatrixRoom, message: Event, matrix_client: MatrixClient):
|
|||||||
await matrix_client.send_html_message(room.room_id, reponse)
|
await matrix_client.send_html_message(room.room_id, reponse)
|
||||||
|
|
||||||
|
|
||||||
|
@properly_fail("Oups, j'ai buggué 🐶")
|
||||||
|
@ignore_when_not_concerned
|
||||||
|
async def dune(room: MatrixRoom, message: Event, matrix_client: MatrixClient):
|
||||||
|
event_parser = MessageEventParser(room=room, event=message, matrix_client=matrix_client)
|
||||||
|
event_parser.do_not_accept_own_message()
|
||||||
|
|
||||||
|
if ("Adrien" in message.body or "adrien" in message.body):
|
||||||
|
await matrix_client.room_typing(room.room_id)
|
||||||
|
await matrix_client.send_html_message(room.room_id, "<em>Lisan al-Gaib !</em>", "m.notice")
|
||||||
|
|
||||||
|
|
||||||
tchap_bot = MatrixBot(
|
tchap_bot = MatrixBot(
|
||||||
env_config.matrix_home_server,
|
env_config.matrix_home_server,
|
||||||
env_config.matrix_bot_username,
|
env_config.matrix_bot_username,
|
||||||
@@ -46,6 +57,6 @@ tchap_bot = MatrixBot(
|
|||||||
ssl=True
|
ssl=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
tchap_bot.callbacks.register_on_message_event(dune)
|
||||||
tchap_bot.callbacks.register_on_message_event(repond)
|
tchap_bot.callbacks.register_on_message_event(repond)
|
||||||
tchap_bot.run()
|
tchap_bot.run()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user