|
32 | 32 | from typing_extensions import Literal
|
33 | 33 |
|
34 | 34 | from . import abc, utils
|
35 |
| -from .channel import _channel_factory, DMChannel, TextChannel, ThreadChannel, VoiceChannel, ForumPost |
| 35 | +from .channel import _channel_factory, DMChannel, TextChannel, ThreadChannel, VoiceChannel, ForumPost, PartialMessageable |
36 | 36 | from .components import *
|
37 | 37 | from .embeds import Embed
|
38 | 38 | from .enums import (
|
@@ -669,7 +669,8 @@ async def edit(
|
669 | 669 |
|
670 | 670 | state = self._state
|
671 | 671 | if not self.channel:
|
672 |
| - self.channel = self._state.add_dm_channel(data=await self._http.get_channel(self.channel_id)) |
| 672 | + ch = await self._http.get_channel(self.channel_id) |
| 673 | + self.channel = _channel_factory(ch['type'])[0](state=state, data=ch) |
673 | 674 |
|
674 | 675 | if response_type is MISSING:
|
675 | 676 | params = handle_message_parameters(
|
@@ -978,8 +979,8 @@ def author(self) -> Union[Member, User]:
|
978 | 979 | return self.member if self.member is not None else self.user
|
979 | 980 |
|
980 | 981 | @property
|
981 |
| - def channel(self) -> Union[DMChannel, TextChannel, ThreadChannel, ForumPost, VoiceChannel]: |
982 |
| - """Union[:class:`~discord.TextChannel`, :class:`~discord.ThreadChannel`, :class:`~discord.DMChannel`, :class:`~discord.VoiceChannel`]: |
| 982 | + def channel(self) -> Union[DMChannel, TextChannel, ThreadChannel, ForumPost, VoiceChannel, PartialMessageable]: |
| 983 | + """Union[:class:`~discord.TextChannel`, :class:`~discord.ThreadChannel`, :class:`~discord.DMChannel`, :class:`~discord.VoiceChannel`, :class:`~discord.ForumPost`, :class:`~discord.PartialMessageable` |
983 | 984 | The channel where the interaction was invoked in.
|
984 | 985 | """
|
985 | 986 | return getattr(self, '_channel', self.guild.get_channel(self.channel_id) if self.guild_id else self._state.get_channel(self.channel_id))
|
|
0 commit comments