42
42
from urllib .parse import parse_qs , urlparse
43
43
44
44
from . import utils
45
+ from .channel import PartialMessageable
45
46
from .components import _component_factory
46
47
from .embeds import Embed
47
48
from .emoji import Emoji
@@ -2001,6 +2002,7 @@ class PartialMessage(Hashable):
2001
2002
- :meth:`DMChannel.get_partial_message`
2002
2003
- :meth:`VoiceChannel.get_partial_message`
2003
2004
- :meth:`StageChannel.get_partial_message`
2005
+ - :meth:`PartialMessageable.get_partial_message`
2004
2006
2005
2007
Note that this class is trimmed down and has no rich attributes.
2006
2008
@@ -2022,7 +2024,7 @@ class PartialMessage(Hashable):
2022
2024
2023
2025
Attributes
2024
2026
----------
2025
- channel: Union[:class:`TextChannel`, :class:`Thread`, :class:`DMChannel`, :class:`VoiceChannel`, :class:`StageChannel`]
2027
+ channel: Union[:class:`TextChannel`, :class:`Thread`, :class:`DMChannel`, :class:`VoiceChannel`, :class:`StageChannel`, :class:`PartialMessageable` ]
2026
2028
The channel associated with this partial message.
2027
2029
id: :class:`int`
2028
2030
The message ID.
@@ -2053,9 +2055,9 @@ def __init__(self, *, channel: PartialMessageableChannel, id: int):
2053
2055
ChannelType .news_thread ,
2054
2056
ChannelType .public_thread ,
2055
2057
ChannelType .private_thread ,
2056
- ):
2058
+ ) and not isinstance ( channel , PartialMessageable ) :
2057
2059
raise TypeError (
2058
- "Expected TextChannel, VoiceChannel, StageChannel, DMChannel or Thread not"
2060
+ "Expected TextChannel, VoiceChannel, StageChannel, DMChannel, Thread or PartialMessageable not"
2059
2061
f" { type (channel )!r} "
2060
2062
)
2061
2063
0 commit comments