modmail icon indicating copy to clipboard operation
modmail copied to clipboard

feat!: Discord Library Upgrade

Open dlsnyder8 opened this issue 1 year ago • 3 comments

Summary Upgrades the bot to use Discord.py 2.3.2

@chamburr Can you make this merge into a dev branch? I'd like to have this merged once the migration is stable, but hold off on merging into main until buttons and views are added.

Notes

  • I made a big effort w/ state.py to overwrite the fewest methods possible to avoid future big rewrites
    • I skipped Emoji caching since we'll move those over to buttons
  • I don't have context on the other class overrides for what they were attempting to accomplish @chamburr if you could add this context, that would be great

Rough todo

  • [ ] Finish class overrides
  • [ ] Clean up comments
  • [ ] Clean up unused imports
  • [ ] issue w/ startup - bot seems to hang, most likely line 240 in main.py

After this PR, but before mainstream release.

  • [ ] Slash command migration https://github.com/chamburr/modmail/issues/113
  • [ ] Open ticket with button https://github.com/chamburr/modmail/issues/131
    • [ ] Multiple ticket categories w/ separate buttons on same embed
  • [ ] Track if users leave/join server w/ an open ticket https://github.com/chamburr/modmail/issues/156

dlsnyder8 avatar Jan 22 '24 05:01 dlsnyder8

It's not done, nor is it in a state where it works (although it doesn't crash anymore). Don't spend too much time looking through it, but if you could answer the questions I had above, that would be cool. Opening the PR to start collaboration on the update

dlsnyder8 avatar Jan 22 '24 05:01 dlsnyder8

Thanks for starting this pull request!

The class overrides are rather hacky, and I can't recall what each of them accomplishes given that it's been a few years since I wrote them. It just happened that everything was needed to have the bot working at that time. I would strongly suggest to experiment and see what works since that's what I did as well.

Also, perhaps we could restrict the scope of this pull request to just the library upgrade, and leave out features like slash commands and buttons for now. Hopefully that can speed up the development cycle, which is important because this pull request would be the foundation for everything else.

chamburr avatar Jan 22 '24 06:01 chamburr

Okay we love hacky. I also wasn't sure on feasibility, but if the redis caching happened at the twilight stage, would that make this more maintainable? Since you have complete control over that - just a thought.

Agree on the scope for this PR - I meant to add spacing between the tasks to show what I wanted to do now versus before a 4.0 release. That was the reason for merging this into a dev branch rather than main.

dlsnyder8 avatar Jan 22 '24 06:01 dlsnyder8