From bae2716aef632f3c36c01eae17de853bfe38114f Mon Sep 17 00:00:00 2001 From: MarkusRost <37275477+Markus-Rost@users.noreply.github.com> Date: Wed, 29 Dec 2021 15:58:11 +0100 Subject: [PATCH] prevent duplicate user for interactions (#15) --- appservice/discord.py | 1 + appservice/main.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/appservice/discord.py b/appservice/discord.py index 5c4907d..2404d27 100644 --- a/appservice/discord.py +++ b/appservice/discord.py @@ -108,6 +108,7 @@ class Message: self.content = message.get("content", "") self.id = message["id"] self.webhook_id = message.get("webhook_id", "") + self.application_id = message.get("application_id", "") self.mentions = [ User(mention) for mention in message.get("mentions", []) diff --git a/appservice/main.py b/appservice/main.py index 474c981..b73a233 100644 --- a/appservice/main.py +++ b/appservice/main.py @@ -490,7 +490,7 @@ class DiscordClient(Gateway): Discord user. """ - if message.webhook_id: + if message.webhook_id and not message.application_id: hashed = hash_str(message.author.username) message.author.id = str(int(message.author.id) + hashed)