Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add default to delete/edit init interaction msg #1481

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions interactions/models/internal/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,18 +544,20 @@ async def send(

respond = send

async def delete(self, message: "Snowflake_Type") -> None:
async def delete(self, message: "Snowflake_Type" = "@original") -> None:
"""
Delete a message sent in response to this interaction.

Args:
message: The message to delete
message: The message to delete. Defaults to @original which represents the initial response message.
"""
await self.client.http.delete_interaction_message(self.client.app.id, self.token, to_snowflake(message))
await self.client.http.delete_interaction_message(
self.client.app.id, self.token, to_snowflake(message) if message != "@original" else message
)

async def edit(
self,
message: "Snowflake_Type",
message: "Snowflake_Type" = "@original",
*,
content: typing.Optional[str] = None,
embeds: typing.Optional[
Expand Down Expand Up @@ -591,7 +593,7 @@ async def edit(
payload=message_payload,
application_id=self.client.app.id,
token=self.token,
message_id=to_snowflake(message),
message_id=to_snowflake(message) if message != "@original" else message,
files=files,
)
if message_data:
Expand Down