Repository: Pycord-Development/pycord

Issue:
NameError: name 'PartialMessageable' is not defined
### Summary

Interaction on DMs causes bot to crash

### Reproduction Steps

Create an interaction on DMs (like a button or dropdown) and click on it after commit a25833ec0745ca8bb4980a997107a11269bbd16c

Doing this should result into a name error:
NameError: name 'PartialMessageable' is not defined

### Minimal Reproducible Code

_No response_

### Expected Results

No bot crashes

### Actual Results

Traceback (most recent call last):
  File "/home/username/.local/lib/python3.8/site-packages/discord/utils.py", line 173, in __get__
    return getattr(instance, self.name)
AttributeError: _cs_channel
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/username/desktop/project/master-slash.py", line 37, in <module>
    bot.run('TOKEN')
  File "/home/username/.local/lib/python3.8/site-packages/discord/client.py", line 668, in run
    return future.result()
  File "/home/username/.local/lib/python3.8/site-packages/discord/client.py", line 647, in runner
    await self.start(*args, **kwargs)
  File "/home/username/.local/lib/python3.8/site-packages/discord/client.py", line 611, in start
    await self.connect(reconnect=reconnect)
  File "/home/username/.local/lib/python3.8/site-packages/discord/client.py", line 517, in connect
    await self.ws.poll_event()
  File "/home/username/.local/lib/python3.8/site-packages/discord/gateway.py", line 563, in poll_event
    await self.received_message(msg.data)
  File "/home/username/.local/lib/python3.8/site-packages/discord/gateway.py", line 513, in received_message
    func(data)
  File "/home/username/.local/lib/python3.8/site-packages/discord/state.py", line 703, in parse_interaction_create
    interaction = Interaction(data=data, state=self)
  File "/home/username/.local/lib/python3.8/site-packages/discord/interactions.py", line 135, in __init__
    self._from_data(data)
  File "/home/username/.local/lib/python3.8/site-packages/discord/interactions.py", line 151, in _from_data
    self.message = Message(state=self._state, channel=self.channel, data=data['message'])  # type: ignore
  File "/home/username/.local/lib/python3.8/site-packages/discord/utils.py", line 175, in __get__
    value = self.function(instance)
  File "/home/username/.local/lib/python3.8/site-packages/discord/interactions.py", line 199, in channel
    return PartialMessageable(state=self._state, id=self.channel_id, type=type)
NameError: name 'PartialMessageable' is not defined

### Intents

intents=discord.Intents.all() intents.typing=False intents.guild_typing=False intents.dm_typing=False

### System Information

- Python v3.9.7-final
- py-cord v2.0.0-alpha
    - py-cord pkg_resources: v2.0.0a4836+g2de2c34d
- aiohttp v3.7.4.post0
- system info: Linux 4.4.0-1097-aws #102-Ubuntu SMP Fri Sep 10 22:18:30 UTC 2021

### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

_No response_


Discussion:

Resolving patch:
diff --git a/discord/interactions.py b/discord/interactions.py
--- a/discord/interactions.py
+++ b/discord/interactions.py
@@ -31,7 +31,7 @@
 from . import utils
 from .enums import try_enum, InteractionType, InteractionResponseType
 from .errors import InteractionResponded, ClientException, InvalidArgument
-from .channel import ChannelType
+from .channel import ChannelType, PartialMessageable
 from .file import File
 from .user import User
 from .member import Member


Test patch: