Ignore mautrix-discord rooms

This commit is contained in:
deadcade 2022-08-25 20:28:14 +02:00
parent eed3adc4a3
commit 9c967371c4

View file

@ -297,6 +297,10 @@ async def message_callback(room: nio.MatrixRoom, event: nio.RoomMessageText) ->
global client, settings, emojis
if settings["debug"]:
print(f"Message received in room {room.display_name}\n{event.sender} | {event.body}")
# Discord messages need different treatment. Absolutely no commands, and if possible no instant message edits.
# Because selfbots are against ToS on Discord, and will get banned within just a few hours to days of usage.
if " (Discord)" in room.display_name:
return
admin = False
if event.sender == client.user_id: # If this is our message
admin = True