From ca33824ba2a8d58a2b089c9fbac1dca55925feac Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 1 May 2022 19:41:45 -0400 Subject: [PATCH] Change AllChannels.id into a property rather than a slot --- discord/app_commands/models.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/discord/app_commands/models.py b/discord/app_commands/models.py index fcac106fe..26dc58688 100644 --- a/discord/app_commands/models.py +++ b/discord/app_commands/models.py @@ -78,23 +78,22 @@ class AllChannels: Attributes ----------- - id: :class:`int` - The guilds id - 1. guild: :class:`~discord.Guild` The guild the application command permission is for. """ - __slots__ = ( - 'id', - 'guild', - ) + __slots__ = 'guild' def __init__(self, guild: Guild): - self.id = guild.id - 1 self.guild = guild + @property + def id(self) -> int: + """:class:`int`: The ID sentinel used to represent all channels. Equivalent to the guild's ID minus 1.""" + return self.guild.id - 1 + def __repr__(self): - return f'' + return f'' class AppCommand(Hashable):