mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-08 04:38:42 +00:00
[commands] Fix issue with category cooldowns outside of guild channels
This commit is contained in:
parent
1ad45f585f
commit
0ce75f3f53
@ -71,7 +71,7 @@ class BucketType(Enum):
|
|||||||
elif self is BucketType.member:
|
elif self is BucketType.member:
|
||||||
return ((msg.guild and msg.guild.id), msg.author.id)
|
return ((msg.guild and msg.guild.id), msg.author.id)
|
||||||
elif self is BucketType.category:
|
elif self is BucketType.category:
|
||||||
return (msg.channel.category or msg.channel).id # type: ignore
|
return (getattr(msg.channel, 'category', None) or msg.channel).id
|
||||||
elif self is BucketType.role:
|
elif self is BucketType.role:
|
||||||
# we return the channel id of a private-channel as there are only roles in guilds
|
# we return the channel id of a private-channel as there are only roles in guilds
|
||||||
# and that yields the same result as for a guild with only the @everyone role
|
# and that yields the same result as for a guild with only the @everyone role
|
||||||
|
Loading…
x
Reference in New Issue
Block a user