Ignore mautrix-discord rooms
This commit is contained in:
parent
eed3adc4a3
commit
9c967371c4
1 changed files with 4 additions and 0 deletions
4
main.py
4
main.py
|
@ -297,6 +297,10 @@ async def message_callback(room: nio.MatrixRoom, event: nio.RoomMessageText) ->
|
||||||
global client, settings, emojis
|
global client, settings, emojis
|
||||||
if settings["debug"]:
|
if settings["debug"]:
|
||||||
print(f"Message received in room {room.display_name}\n{event.sender} | {event.body}")
|
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
|
admin = False
|
||||||
if event.sender == client.user_id: # If this is our message
|
if event.sender == client.user_id: # If this is our message
|
||||||
admin = True
|
admin = True
|
||||||
|
|
Loading…
Reference in a new issue