interactions.py icon indicating copy to clipboard operation
interactions.py copied to clipboard

Fix timeout for ephemeral paginators and hybrid commands

Open AutonomousCat opened this issue 9 months ago • 0 comments

Pull Request Type

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

Description

While I was writing a command that uses ephemeral paginators, I noticed the timeout resulted in a 404 NotFound. While looking for ways to resolve this, I noticed that HybridContext required a message object in it's edit() function, so I used _prefixed_ctx to determine HybridContext. Probably not the best way to handle this, but I did what I could.

Changes

  • Added edit field to Timeout class to store the message edit coroutine
  • Updated send() and reply() to use the appropriate edit method based on command type

Test Scenarios

I tested with ephemeral, non-ephemeral, send, reply, slash, hybrid, and prefixed. Now works in all cases without errors.

Python Compatibility

  • [ ] I've ensured my code works on Python 3.10.x
  • [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
  • [x] 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

AutonomousCat avatar Jan 25 '25 05:01 AutonomousCat