mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-11-11 19:07:28 +03:00
feat(interactions): fetch_original_message() method
This commit is contained in:
parent
4012a047cb
commit
9365b18ea2
2 changed files with 27 additions and 0 deletions
|
@ -373,6 +373,12 @@ class Interaction(APIModelBase):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def fetch_original_message(self) -> Message:
|
||||||
|
"""Fetch Original Interaction Response from the Discord API."""
|
||||||
|
return await self._client.rest.get_original_interaction_response(
|
||||||
|
self.application_id, self.token
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(repr=False)
|
@dataclass(repr=False)
|
||||||
class ResolvedData(APIModelBase):
|
class ResolvedData(APIModelBase):
|
||||||
|
|
|
@ -113,6 +113,27 @@ class RESTApp:
|
||||||
|
|
||||||
return _choose_channel_type(data)
|
return _choose_channel_type(data)
|
||||||
|
|
||||||
|
async def get_original_interaction_response(
|
||||||
|
self, application_id: Union[Snowflake, str, int], interaction_token: str
|
||||||
|
) -> Message:
|
||||||
|
"""|coro|
|
||||||
|
|
||||||
|
[**REST API**] Fetch Original Interaction Response from the Discord API.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
application_id : Union[:class:`~melisa.utils.snowflake.Snowflake`, str, int]
|
||||||
|
Id of interaction to fetch
|
||||||
|
interaction_token: str
|
||||||
|
Interaction token
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = await self._http.get(
|
||||||
|
f"/webhooks/{application_id}/{interaction_token}/messages/@original"
|
||||||
|
)
|
||||||
|
|
||||||
|
return Message.from_dict(data)
|
||||||
|
|
||||||
async def delete_message(
|
async def delete_message(
|
||||||
self,
|
self,
|
||||||
channel_id: Union[Snowflake, str, int],
|
channel_id: Union[Snowflake, str, int],
|
||||||
|
|
Loading…
Reference in a new issue