mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-08-11 05:52:12 +00:00
Guard AppCommandThread.guild attribute access
This commit is contained in:
parent
db42eba4fa
commit
ec409a0a7b
@ -901,7 +901,7 @@ class AppCommandThread(Hashable):
|
|||||||
def parent(self) -> Optional[Union[ForumChannel, TextChannel]]:
|
def parent(self) -> Optional[Union[ForumChannel, TextChannel]]:
|
||||||
"""Optional[Union[:class:`~discord.ForumChannel`, :class:`~discord.TextChannel`]]: The parent channel
|
"""Optional[Union[:class:`~discord.ForumChannel`, :class:`~discord.TextChannel`]]: The parent channel
|
||||||
this thread belongs to."""
|
this thread belongs to."""
|
||||||
return self.guild.get_channel(self.parent_id) # type: ignore
|
return self.guild and self.guild.get_channel(self.parent_id) # type: ignore
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def flags(self) -> ChannelFlags:
|
def flags(self) -> ChannelFlags:
|
||||||
@ -917,7 +917,7 @@ class AppCommandThread(Hashable):
|
|||||||
|
|
||||||
.. versionadded:: 2.6
|
.. versionadded:: 2.6
|
||||||
"""
|
"""
|
||||||
return self.guild.get_member(self.owner_id) # type: ignore
|
return self.guild and self.guild.get_member(self.owner_id)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mention(self) -> str:
|
def mention(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user