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

cc/interactions: add support for deleting responses and followups #1722

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

SoggySaussages
Copy link
Contributor

@SoggySaussages SoggySaussages commented Sep 13, 2024

Previously there was no support for deleting responses or followups
since deleteMessage was sufficient for all available use cases. Since
then Discord has added support for deletion of ephemeral messages which
may only be deleted by directly deleting the response or followup. This
PR adds that functionality.

Add a context func to delete interaction responses or followups.
Necessary for deletion of ephemeral messages.

Function Description
deleteInteractionResponse interactionToken messageID (delay) Deletes one of the bot’s responses to an interaction. interactionToken must be a valid token or nil to target the triggering interaction. messageID must be a valid message ID of a followup message, or nil to target the original interaction response. delay is optional and defaults to 10 seconds, which is also the maximum delay this function supports. For longer delays, consider using execCC if you are trying to delete an ephemeral response, or deleteMessage if you are trying to delete a regular response.

Signed-off-by: SoggySaussages vmdmaharaj@gmail.com

Previously there was no support for deleting responses or followups
since `deleteMessage` was sufficient for all available use cases. Since
then Discord has added support for deletion of ephemeral messages which
may only be deleted by directly deleting the response or followup. This
commit adds that functionality.

Signed-off-by: SoggySaussages <vmdmaharaj@gmail.com>
Add a context func to delete interaction responses or followups.
Necessary for deletion of ephemeral messages.

| **Function**                                         | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `deleteResponse` interactionToken messageID (delay)  | Deletes one of the bot’s responses to an interaction. `interactionToken` must be a valid token or `nil` to target the triggering interaction. `messageID` must be a valid message ID of a followup message, or `nil` to target the original interaction response. `delay` is optional and defaults to 10 seconds, which is also the maximum delay this function supports. For longer delays, consider using `execCC` if you are trying to delete an ephemeral response, or `deleteMessage` if you are trying to delete a regular response. |

Signed-off-by: SoggySaussages <vmdmaharaj@gmail.com>
Signed-off-by: SoggySaussages <vmdmaharaj@gmail.com>
Signed-off-by: SoggySaussages <vmdmaharaj@gmail.com>
@SoggySaussages SoggySaussages changed the title Delete ephemerals cc/interactions: add support for deleting responses and followups Sep 13, 2024
@ashishjh-bst ashishjh-bst merged commit b4fdf40 into botlabs-gg:dev Sep 13, 2024
1 check passed
l-zeuch added a commit to botlabs-gg/yagpdb-docs-v2 that referenced this pull request Sep 26, 2024
See botlabs-gg/yagpdb#1722.

Signed-off-by: Luca Zeuch <l-zeuch@email.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants