prevent duplicate user for interactions (#15)

This commit is contained in:
MarkusRost 2021-12-29 15:58:11 +01:00 committed by GitHub
parent 84afc8c503
commit bae2716aef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -108,6 +108,7 @@ class Message:
self.content = message.get("content", "") self.content = message.get("content", "")
self.id = message["id"] self.id = message["id"]
self.webhook_id = message.get("webhook_id", "") self.webhook_id = message.get("webhook_id", "")
self.application_id = message.get("application_id", "")
self.mentions = [ self.mentions = [
User(mention) for mention in message.get("mentions", []) User(mention) for mention in message.get("mentions", [])

View file

@ -490,7 +490,7 @@ class DiscordClient(Gateway):
Discord user. Discord user.
""" """
if message.webhook_id: if message.webhook_id and not message.application_id:
hashed = hash_str(message.author.username) hashed = hash_str(message.author.username)
message.author.id = str(int(message.author.id) + hashed) message.author.id = str(int(message.author.id) + hashed)