From a9b611fca0c5a123396374321c424225ddbbfa53 Mon Sep 17 00:00:00 2001 From: AstreaTSS <25420078+AstreaTSS@users.noreply.github.com> Date: Thu, 24 Aug 2023 21:55:11 -0400 Subject: [PATCH] fix: rely on guild id instead of guild for buckets --- interactions/models/internal/cooldowns.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interactions/models/internal/cooldowns.py b/interactions/models/internal/cooldowns.py index 1d1765f8f..e0fa31d48 100644 --- a/interactions/models/internal/cooldowns.py +++ b/interactions/models/internal/cooldowns.py @@ -47,15 +47,15 @@ async def get_key(self, context: "BaseContext") -> Any: if self is Buckets.USER: return context.author.id if self is Buckets.GUILD: - return context.guild_id if context.guild else context.author.id + return context.guild_id or context.author.id if self is Buckets.CHANNEL: return context.channel.id if self is Buckets.MEMBER: - return (context.guild_id, context.author.id) if context.guild else context.author.id + return (context.guild_id, context.author.id) if context.guild_id else context.author.id if self is Buckets.CATEGORY: return await context.channel.parent_id if context.channel.parent else context.channel.id if self is Buckets.ROLE: - return context.author.top_role.id if context.guild else context.channel.id + return context.author.top_role.id if context.guild_id else context.channel.id return context.author.id def __call__(self, context: "BaseContext") -> Any: