|
|
@ -27,7 +27,7 @@ DEALINGS IN THE SOFTWARE. |
|
|
|
from __future__ import annotations |
|
|
|
|
|
|
|
import logging |
|
|
|
from typing import Any, Dict, Optional, Generic, TYPE_CHECKING, Sequence, Tuple, Union, List |
|
|
|
from typing import Any, Dict, Optional, Generic, TYPE_CHECKING, Sequence, Tuple, Union, List, overload |
|
|
|
import asyncio |
|
|
|
import datetime |
|
|
|
|
|
|
@ -76,7 +76,7 @@ if TYPE_CHECKING: |
|
|
|
from .mentions import AllowedMentions |
|
|
|
from aiohttp import ClientSession |
|
|
|
from .embeds import Embed |
|
|
|
from .ui.view import BaseView |
|
|
|
from .ui.view import BaseView, View, LayoutView |
|
|
|
from .app_commands.models import Choice, ChoiceT |
|
|
|
from .ui.modal import Modal |
|
|
|
from .channel import VoiceChannel, StageChannel, TextChannel, ForumChannel, CategoryChannel, DMChannel, GroupChannel |
|
|
@ -469,6 +469,30 @@ class Interaction(Generic[ClientT]): |
|
|
|
self._original_response = message |
|
|
|
return message |
|
|
|
|
|
|
|
@overload |
|
|
|
async def edit_original_response( |
|
|
|
self, |
|
|
|
*, |
|
|
|
attachments: Sequence[Union[Attachment, File]] = MISSING, |
|
|
|
view: LayoutView, |
|
|
|
allowed_mentions: Optional[AllowedMentions] = None, |
|
|
|
) -> InteractionMessage: |
|
|
|
... |
|
|
|
|
|
|
|
@overload |
|
|
|
async def edit_original_response( |
|
|
|
self, |
|
|
|
*, |
|
|
|
content: Optional[str] = MISSING, |
|
|
|
embeds: Sequence[Embed] = MISSING, |
|
|
|
embed: Optional[Embed] = MISSING, |
|
|
|
attachments: Sequence[Union[Attachment, File]] = MISSING, |
|
|
|
view: Optional[View] = MISSING, |
|
|
|
allowed_mentions: Optional[AllowedMentions] = None, |
|
|
|
poll: Poll = MISSING, |
|
|
|
) -> InteractionMessage: |
|
|
|
... |
|
|
|
|
|
|
|
async def edit_original_response( |
|
|
|
self, |
|
|
|
*, |
|
|
@ -889,6 +913,41 @@ class InteractionResponse(Generic[ClientT]): |
|
|
|
) |
|
|
|
self._response_type = InteractionResponseType.pong |
|
|
|
|
|
|
|
@overload |
|
|
|
async def send_message( |
|
|
|
self, |
|
|
|
*, |
|
|
|
file: File = MISSING, |
|
|
|
files: Sequence[File] = MISSING, |
|
|
|
view: LayoutView, |
|
|
|
ephemeral: bool = False, |
|
|
|
allowed_mentions: AllowedMentions = MISSING, |
|
|
|
suppress_embeds: bool = False, |
|
|
|
silent: bool = False, |
|
|
|
delete_after: Optional[float] = None, |
|
|
|
) -> InteractionCallbackResponse[ClientT]: |
|
|
|
... |
|
|
|
|
|
|
|
@overload |
|
|
|
async def send_message( |
|
|
|
self, |
|
|
|
content: Optional[Any] = None, |
|
|
|
*, |
|
|
|
embed: Embed = MISSING, |
|
|
|
embeds: Sequence[Embed] = MISSING, |
|
|
|
file: File = MISSING, |
|
|
|
files: Sequence[File] = MISSING, |
|
|
|
view: View = MISSING, |
|
|
|
tts: bool = False, |
|
|
|
ephemeral: bool = False, |
|
|
|
allowed_mentions: AllowedMentions = MISSING, |
|
|
|
suppress_embeds: bool = False, |
|
|
|
silent: bool = False, |
|
|
|
delete_after: Optional[float] = None, |
|
|
|
poll: Poll = MISSING, |
|
|
|
) -> InteractionCallbackResponse[ClientT]: |
|
|
|
... |
|
|
|
|
|
|
|
async def send_message( |
|
|
|
self, |
|
|
|
content: Optional[Any] = None, |
|
|
@ -1042,6 +1101,33 @@ class InteractionResponse(Generic[ClientT]): |
|
|
|
type=self._response_type, |
|
|
|
) |
|
|
|
|
|
|
|
@overload |
|
|
|
async def edit_message( |
|
|
|
self, |
|
|
|
*, |
|
|
|
attachments: Sequence[Union[Attachment, File]] = MISSING, |
|
|
|
view: LayoutView, |
|
|
|
allowed_mentions: Optional[AllowedMentions] = MISSING, |
|
|
|
delete_after: Optional[float] = None, |
|
|
|
suppress_embeds: bool = MISSING, |
|
|
|
) -> Optional[InteractionCallbackResponse[ClientT]]: |
|
|
|
... |
|
|
|
|
|
|
|
@overload |
|
|
|
async def edit_message( |
|
|
|
self, |
|
|
|
*, |
|
|
|
content: Optional[Any] = MISSING, |
|
|
|
embed: Optional[Embed] = MISSING, |
|
|
|
embeds: Sequence[Embed] = MISSING, |
|
|
|
attachments: Sequence[Union[Attachment, File]] = MISSING, |
|
|
|
view: Optional[View] = MISSING, |
|
|
|
allowed_mentions: Optional[AllowedMentions] = MISSING, |
|
|
|
delete_after: Optional[float] = None, |
|
|
|
suppress_embeds: bool = MISSING, |
|
|
|
) -> Optional[InteractionCallbackResponse[ClientT]]: |
|
|
|
... |
|
|
|
|
|
|
|
async def edit_message( |
|
|
|
self, |
|
|
|
*, |
|
|
@ -1333,6 +1419,32 @@ class InteractionMessage(Message): |
|
|
|
__slots__ = () |
|
|
|
_state: _InteractionMessageState |
|
|
|
|
|
|
|
@overload |
|
|
|
async def edit( |
|
|
|
self, |
|
|
|
*, |
|
|
|
attachments: Sequence[Union[Attachment, File]] = MISSING, |
|
|
|
view: LayoutView, |
|
|
|
allowed_mentions: Optional[AllowedMentions] = None, |
|
|
|
delete_after: Optional[float] = None, |
|
|
|
) -> InteractionMessage: |
|
|
|
... |
|
|
|
|
|
|
|
@overload |
|
|
|
async def edit( |
|
|
|
self, |
|
|
|
*, |
|
|
|
content: Optional[str] = MISSING, |
|
|
|
embeds: Sequence[Embed] = MISSING, |
|
|
|
embed: Optional[Embed] = MISSING, |
|
|
|
attachments: Sequence[Union[Attachment, File]] = MISSING, |
|
|
|
view: Optional[View] = MISSING, |
|
|
|
allowed_mentions: Optional[AllowedMentions] = None, |
|
|
|
delete_after: Optional[float] = None, |
|
|
|
poll: Poll = MISSING, |
|
|
|
) -> InteractionMessage: |
|
|
|
... |
|
|
|
|
|
|
|
async def edit( |
|
|
|
self, |
|
|
|
*, |
|
|
@ -1412,7 +1524,7 @@ class InteractionMessage(Message): |
|
|
|
embeds=embeds, |
|
|
|
embed=embed, |
|
|
|
attachments=attachments, |
|
|
|
view=view, |
|
|
|
view=view, # type: ignore |
|
|
|
allowed_mentions=allowed_mentions, |
|
|
|
poll=poll, |
|
|
|
) |
|
|
|