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

fix: allow delete_after for ephemeral messages #1467

Merged

Conversation

AstreaTSS
Copy link
Member

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

This PR allows using delete_after for ephemeral messages, which previously produced an error due to not passing the context in for message.delete(...). This uses a purposely hidden kwarg to do so - let me know if that needs to be changed.

Changes

  • Use a hidden kwarg for SendMixin to determine if the mixin should pass in itself for message.delete(...). I figured it was better than using an isinstance and potentially maybe causing recursive imports.
  • Make InteractionContext and HybridContext pass this value as appropriate.

Related Issues

Fixes #1465.

Test Scenarios

  • Send an ephemeral message through a slash command (broken on hybrid commands due to a different bug that will be PRed shortly).
  • Use delete_after while sending.

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@LordOfPolls LordOfPolls merged commit 0301e4e into interactions-py:unstable Jul 5, 2023
1 check passed
@AstreaTSS AstreaTSS deleted the ephemeral-delete-after branch July 13, 2023 19:19
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