|
29 | 29 | import datetime
|
30 | 30 | from typing import TYPE_CHECKING, Any, Coroutine, Union
|
31 | 31 |
|
| 32 | +from typing_extensions import deprecated |
| 33 | + |
32 | 34 | from . import utils
|
33 | 35 | from .channel import ChannelType, PartialMessageable, _threaded_channel_factory
|
34 | 36 | from .enums import (
|
|
47 | 49 | from .object import Object
|
48 | 50 | from .permissions import Permissions
|
49 | 51 | from .user import User
|
| 52 | +from .utils import deprecated_message |
50 | 53 | from .webhook.async_ import (
|
51 | 54 | Webhook,
|
52 | 55 | WebhookMessage,
|
@@ -315,7 +318,10 @@ def is_component(self) -> bool:
|
315 | 318 | return self.type == InteractionType.component
|
316 | 319 |
|
317 | 320 | @utils.cached_slot_property("_cs_channel")
|
318 |
| - @utils.deprecated("Interaction.channel", "2.7", stacklevel=4) |
| 321 | + @deprecated( |
| 322 | + deprecated_message("Interaction.cached_channel", "Interaction.channel", "2.7"), |
| 323 | + stacklevel=2, |
| 324 | + ) |
319 | 325 | def cached_channel(self) -> InteractionChannel | None:
|
320 | 326 | """The cached channel from which the interaction was sent.
|
321 | 327 | DM channels are not resolved. These are :class:`PartialMessageable` instead.
|
@@ -457,7 +463,11 @@ async def original_response(self) -> InteractionMessage:
|
457 | 463 | self._original_response = message
|
458 | 464 | return message
|
459 | 465 |
|
460 |
| - @utils.deprecated("Interaction.original_response", "2.2") |
| 466 | + @deprecated( |
| 467 | + deprecated_message( |
| 468 | + "Interaction.original_message", "Interaction.original_response", "2.2" |
| 469 | + ) |
| 470 | + ) |
461 | 471 | async def original_message(self):
|
462 | 472 | """An alias for :meth:`original_response`.
|
463 | 473 |
|
@@ -584,7 +594,13 @@ async def edit_original_response(
|
584 | 594 |
|
585 | 595 | return message
|
586 | 596 |
|
587 |
| - @utils.deprecated("Interaction.edit_original_response", "2.2") |
| 597 | + @deprecated( |
| 598 | + deprecated_message( |
| 599 | + "Interaction.edit_original_message", |
| 600 | + "Interaction.edit_original_response", |
| 601 | + "2.2", |
| 602 | + ) |
| 603 | + ) |
588 | 604 | async def edit_original_message(self, **kwargs):
|
589 | 605 | """An alias for :meth:`edit_original_response`.
|
590 | 606 |
|
@@ -642,7 +658,13 @@ async def delete_original_response(self, *, delay: float | None = None) -> None:
|
642 | 658 | else:
|
643 | 659 | await func
|
644 | 660 |
|
645 |
| - @utils.deprecated("Interaction.delete_original_response", "2.2") |
| 661 | + @deprecated( |
| 662 | + deprecated_message( |
| 663 | + "Interaction.delete_original_message", |
| 664 | + "Interaction.delete_original_response", |
| 665 | + "2.2", |
| 666 | + ) |
| 667 | + ) |
646 | 668 | async def delete_original_message(self, **kwargs):
|
647 | 669 | """An alias for :meth:`delete_original_response`.
|
648 | 670 |
|
@@ -1288,7 +1310,13 @@ async def send_modal(self, modal: Modal) -> Interaction:
|
1288 | 1310 | self._parent._state.store_modal(modal, self._parent.user.id)
|
1289 | 1311 | return self._parent
|
1290 | 1312 |
|
1291 |
| - @utils.deprecated("a button with type ButtonType.premium", "2.6") |
| 1313 | + @deprecated( |
| 1314 | + deprecated_message( |
| 1315 | + "InteractionResponse.premium_required", |
| 1316 | + "a button with type ButtonType.premium", |
| 1317 | + "2.6", |
| 1318 | + ) |
| 1319 | + ) |
1292 | 1320 | async def premium_required(self) -> Interaction:
|
1293 | 1321 | """|coro|
|
1294 | 1322 |
|
|
0 commit comments