53
53
54
54
from typing import Callable , Awaitable
55
55
56
- from ..utils import cached_property
57
-
58
56
T = TypeVar ("T" )
59
57
CogT = TypeVar ("CogT" , bound = "Cog" )
60
58
@@ -136,53 +134,53 @@ async def invoke(
136
134
"""
137
135
return await command (self , * args , ** kwargs )
138
136
139
- @cached_property
137
+ @property
140
138
def channel (self ) -> InteractionChannel | None :
141
139
"""Union[:class:`abc.GuildChannel`, :class:`PartialMessageable`, :class:`Thread`]:
142
140
Returns the channel associated with this context's command. Shorthand for :attr:`.Interaction.channel`.
143
141
"""
144
142
return self .interaction .channel
145
143
146
- @cached_property
144
+ @property
147
145
def channel_id (self ) -> int | None :
148
146
"""Returns the ID of the channel associated with this context's command.
149
147
Shorthand for :attr:`.Interaction.channel_id`.
150
148
"""
151
149
return self .interaction .channel_id
152
150
153
- @cached_property
151
+ @property
154
152
def guild (self ) -> Guild | None :
155
153
"""Returns the guild associated with this context's command.
156
154
Shorthand for :attr:`.Interaction.guild`.
157
155
"""
158
156
return self .interaction .guild
159
157
160
- @cached_property
158
+ @property
161
159
def guild_id (self ) -> int | None :
162
160
"""Returns the ID of the guild associated with this context's command.
163
161
Shorthand for :attr:`.Interaction.guild_id`.
164
162
"""
165
163
return self .interaction .guild_id
166
164
167
- @cached_property
165
+ @property
168
166
def locale (self ) -> str | None :
169
167
"""Returns the locale of the guild associated with this context's command.
170
168
Shorthand for :attr:`.Interaction.locale`.
171
169
"""
172
170
return self .interaction .locale
173
171
174
- @cached_property
172
+ @property
175
173
def guild_locale (self ) -> str | None :
176
174
"""Returns the locale of the guild associated with this context's command.
177
175
Shorthand for :attr:`.Interaction.guild_locale`.
178
176
"""
179
177
return self .interaction .guild_locale
180
178
181
- @cached_property
179
+ @property
182
180
def app_permissions (self ) -> Permissions :
183
181
return self .interaction .app_permissions
184
182
185
- @cached_property
183
+ @property
186
184
def me (self ) -> Member | ClientUser | None :
187
185
"""Union[:class:`.Member`, :class:`.ClientUser`]:
188
186
Similar to :attr:`.Guild.me` except it may return the :class:`.ClientUser` in private message
@@ -194,14 +192,14 @@ def me(self) -> Member | ClientUser | None:
194
192
else self .bot .user
195
193
)
196
194
197
- @cached_property
195
+ @property
198
196
def message (self ) -> Message | None :
199
197
"""Returns the message sent with this context's command.
200
198
Shorthand for :attr:`.Interaction.message`, if applicable.
201
199
"""
202
200
return self .interaction .message
203
201
204
- @cached_property
202
+ @property
205
203
def user (self ) -> Member | User :
206
204
"""Returns the user that sent this context's command.
207
205
Shorthand for :attr:`.Interaction.user`.
@@ -220,7 +218,7 @@ def voice_client(self) -> VoiceClient | None:
220
218
221
219
return self .interaction .guild .voice_client
222
220
223
- @cached_property
221
+ @property
224
222
def response (self ) -> InteractionResponse :
225
223
"""Returns the response object associated with this context's command.
226
224
Shorthand for :attr:`.Interaction.response`.
0 commit comments