diff options
| author | Rapptz <[email protected]> | 2021-05-29 05:49:19 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-05-29 05:49:19 -0400 |
| commit | d78e5d979d143648bb3514b12ae4d025d758b900 (patch) | |
| tree | 0dc48a7b92abf6a11e890fa8c0a79d3b55b44bfe /discord/abc.py | |
| parent | Typehint AllowedMentions (diff) | |
| download | discord.py-d78e5d979d143648bb3514b12ae4d025d758b900.tar.xz discord.py-d78e5d979d143648bb3514b12ae4d025d758b900.zip | |
Refactor and type hint invites
Diffstat (limited to 'discord/abc.py')
| -rw-r--r-- | discord/abc.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/discord/abc.py b/discord/abc.py index da1636f2..2b44fa30 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1106,14 +1106,8 @@ class GuildChannel: state = self._state data = await state.http.invites_from_channel(self.id) - result = [] - - for invite in data: - invite['channel'] = self - invite['guild'] = self.guild - result.append(Invite(state=state, data=invite)) - - return result + guild = self.guild + return [Invite(state=state, data=invite, channel=self, guild=guild) for invite in data] class Messageable(Protocol): |