From ca5e0b2d283a32611b79832ced0cc570717d78cc Mon Sep 17 00:00:00 2001 From: git-bruh Date: Mon, 7 Dec 2020 21:26:42 +0530 Subject: [PATCH] Use Discord AllowedMentions --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 840f686..ab9f4b1 100644 --- a/main.py +++ b/main.py @@ -151,9 +151,6 @@ class MatrixClient(nio.AsyncClient): if member: message = message.replace(mention[1], member[0].mention) - message = message.replace("@everyone", "@\u200Beveryone") - message = message.replace("@here", "@\u200Bhere") - return message @@ -318,7 +315,10 @@ def main(): intents = discord.Intents.default() intents.members = True - DiscordClient(intents=intents).run(config["token"]) + allowed_mentions = discord.AllowedMentions(everyone=False, roles=False) + + DiscordClient(intents=intents, allowed_mentions=allowed_mentions).run( + config["token"]) if __name__ == "__main__":