Improve generic duck type programming with PartialMessageable

This adds jump_url, permissions_for, and created_at. Luckily, most
cases of this type being constructed already have the guild_id at
creation time.
This commit is contained in:
Rapptz
2022-05-03 10:49:52 -04:00
parent e9c7c09ebf
commit 8699d2139a
8 changed files with 59 additions and 11 deletions

View File

@ -223,7 +223,7 @@ class Interaction:
if channel is None:
if self.channel_id is not None:
type = ChannelType.text if self.guild_id is not None else ChannelType.private
return PartialMessageable(state=self._state, id=self.channel_id, type=type)
return PartialMessageable(state=self._state, guild_id=self.guild_id, id=self.channel_id, type=type)
return None
return channel