Added a update_view() function in utils.py to easily update views. It takes in a discord interaction to retrieve the channel and message_id for the current view, as well as a new view object that is used to replace the old view.
Issues
Closes #306
Type of change
Select one or more of the following:
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Other (describe below)
How Has This Been Tested?
Created a Cog.listener explicitly for testing and on the interaction (button click) would change the current view to the new view. Worked like a charm :four_leaf_clover:
Checklist:
[x] All local commits have been pushed to remote
[x] All changes on the base branch have been merged into this branch, either by rebase or merge
[x] My code is PEP-8 compliant (excluding maximum line length, keep that to 100ish characters)
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
Description
Added a
update_view()
function inutils.py
to easily update views. It takes in a discord interaction to retrieve the channel and message_id for the current view, as well as a new view object that is used to replace the old view.Issues
Closes #306
Type of change
Select one or more of the following:
How Has This Been Tested?
Created a Cog.listener explicitly for testing and on the interaction (button click) would change the current view to the new view. Worked like a charm :four_leaf_clover:
Checklist: