Use Discord AllowedMentions

This commit is contained in:
git-bruh 2020-12-07 21:26:42 +05:30
parent 058eaa94d1
commit ca5e0b2d28
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -151,9 +151,6 @@ class MatrixClient(nio.AsyncClient):
if member: if member:
message = message.replace(mention[1], member[0].mention) message = message.replace(mention[1], member[0].mention)
message = message.replace("@everyone", "@\u200Beveryone")
message = message.replace("@here", "@\u200Bhere")
return message return message
@ -318,7 +315,10 @@ def main():
intents = discord.Intents.default() intents = discord.Intents.default()
intents.members = True 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__": if __name__ == "__main__":