Skip to content

Commit 0945662

Browse files
authored
fix: rely on guild id instead of guild for buckets (#1541)
1 parent 80c1275 commit 0945662

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

interactions/models/internal/cooldowns.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ async def get_key(self, context: "BaseContext") -> Any:
4747
if self is Buckets.USER:
4848
return context.author.id
4949
if self is Buckets.GUILD:
50-
return context.guild_id if context.guild else context.author.id
50+
return context.guild_id or context.author.id
5151
if self is Buckets.CHANNEL:
5252
return context.channel.id
5353
if self is Buckets.MEMBER:
54-
return (context.guild_id, context.author.id) if context.guild else context.author.id
54+
return (context.guild_id, context.author.id) if context.guild_id else context.author.id
5555
if self is Buckets.CATEGORY:
5656
return await context.channel.parent_id if context.channel.parent else context.channel.id
5757
if self is Buckets.ROLE:
58-
return context.author.top_role.id if context.guild else context.channel.id
58+
return context.author.top_role.id if context.guild_id else context.channel.id
5959
return context.author.id
6060

6161
def __call__(self, context: "BaseContext") -> Any:

0 commit comments

Comments
 (0)