Skip to content

Commit fbb8803

Browse files
authored
Use hasattr to check for guild attribute
The previous GuildChannel check would fail for threads in v2
1 parent 309c702 commit fbb8803

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

discord/ext/menus/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,7 @@ async def start(self, ctx, *, channel=None, wait=False):
696696
self.ctx = ctx
697697
self._author_id = ctx.author.id
698698
channel = channel or ctx.channel
699-
is_guild = isinstance(channel, discord.abc.GuildChannel)
700-
me = channel.guild.me if is_guild else ctx.bot.user
699+
me = channel.guild.me if hasattr(channel, 'guild') else ctx.bot.user
701700
permissions = channel.permissions_for(me)
702701
self.__me = discord.Object(id=me.id)
703702
self._verify_permissions(ctx, channel, permissions)

0 commit comments

Comments
 (0)