3232from discord .webhook .async_ import Webhook
3333
3434if TYPE_CHECKING :
35+ from typing import Awaitable , Callable
36+
3537 from typing_extensions import ParamSpec
3638
3739 import discord
38- from .. import Bot
39- from ..state import ConnectionState
40- from ..voice_client import VoiceClient
4140
42- from .core import ApplicationCommand , Option
43- from ..interactions import InteractionChannel
41+ from .. import Bot
42+ from ..client import ClientUser
43+ from ..cog import Cog
4444 from ..guild import Guild
45+ from ..interactions import InteractionChannel
4546 from ..member import Member
4647 from ..message import Message
47- from ..user import User
4848 from ..permissions import Permissions
49- from ..client import ClientUser
50-
51- from ..cog import Cog
49+ from ..state import ConnectionState
50+ from .. user import User
51+ from ..voice_client import VoiceClient
5252 from ..webhook import WebhookMessage
53-
54- from typing import Callable , Awaitable
55-
56- from ..utils import cached_property
53+ from .core import ApplicationCommand , Option
5754
5855T = TypeVar ("T" )
5956CogT = TypeVar ("CogT" , bound = "Cog" )
@@ -142,68 +139,68 @@ def command(self) -> ApplicationCommand | None:
142139 def command (self , value : ApplicationCommand | None ) -> None :
143140 self .interaction .command = value
144141
145- @cached_property
142+ @property
146143 def channel (self ) -> InteractionChannel | None :
147144 """Union[:class:`abc.GuildChannel`, :class:`PartialMessageable`, :class:`Thread`]:
148145 Returns the channel associated with this context's command. Shorthand for :attr:`.Interaction.channel`.
149146 """
150147 return self .interaction .channel
151148
152- @cached_property
149+ @property
153150 def channel_id (self ) -> int | None :
154151 """Returns the ID of the channel associated with this context's command.
155152 Shorthand for :attr:`.Interaction.channel_id`.
156153 """
157154 return self .interaction .channel_id
158155
159- @cached_property
156+ @property
160157 def guild (self ) -> Guild | None :
161158 """Returns the guild associated with this context's command.
162159 Shorthand for :attr:`.Interaction.guild`.
163160 """
164161 return self .interaction .guild
165162
166- @cached_property
163+ @property
167164 def guild_id (self ) -> int | None :
168165 """Returns the ID of the guild associated with this context's command.
169166 Shorthand for :attr:`.Interaction.guild_id`.
170167 """
171168 return self .interaction .guild_id
172169
173- @cached_property
170+ @property
174171 def locale (self ) -> str | None :
175172 """Returns the locale of the guild associated with this context's command.
176173 Shorthand for :attr:`.Interaction.locale`.
177174 """
178175 return self .interaction .locale
179176
180- @cached_property
177+ @property
181178 def guild_locale (self ) -> str | None :
182179 """Returns the locale of the guild associated with this context's command.
183180 Shorthand for :attr:`.Interaction.guild_locale`.
184181 """
185182 return self .interaction .guild_locale
186183
187- @cached_property
184+ @property
188185 def app_permissions (self ) -> Permissions :
189186 return self .interaction .app_permissions
190187
191- @cached_property
188+ @property
192189 def me (self ) -> Member | ClientUser | None :
193190 """Union[:class:`.Member`, :class:`.ClientUser`]:
194191 Similar to :attr:`.Guild.me` except it may return the :class:`.ClientUser` in private message
195192 message contexts, or when :meth:`Intents.guilds` is absent.
196193 """
197194 return self .interaction .guild .me if self .interaction .guild is not None else self .bot .user
198195
199- @cached_property
196+ @property
200197 def message (self ) -> Message | None :
201198 """Returns the message sent with this context's command.
202199 Shorthand for :attr:`.Interaction.message`, if applicable.
203200 """
204201 return self .interaction .message
205202
206- @cached_property
203+ @property
207204 def user (self ) -> Member | User :
208205 """Returns the user that sent this context's command.
209206 Shorthand for :attr:`.Interaction.user`.
@@ -222,7 +219,7 @@ def voice_client(self) -> VoiceClient | None:
222219
223220 return self .interaction .guild .voice_client
224221
225- @cached_property
222+ @property
226223 def response (self ) -> InteractionResponse :
227224 """Returns the response object associated with this context's command.
228225 Shorthand for :attr:`.Interaction.response`.
@@ -263,7 +260,7 @@ def unselected_options(self) -> list[Option] | None:
263260 return self .command .options # type: ignore
264261 return None
265262
266- @cached_property
263+ @property
267264 def attachment_size_limit (self ) -> int :
268265 """Returns the attachment size limit associated with this context's interaction.
269266 Shorthand for :attr:`.Interaction.attachment_size_limit`.
0 commit comments