Conversation
Modify checks to allow for interoperability with application commands.
Lumped everything under the cog's class with more sensible ordering.
Update test suite to work with latest version of tortoise ORM. Notable changes include refreshing cached methods in tests, and adding tzdata to the dev dependencies.
Tests are now run on pull requests, while codestyle checks are only run on pushes.
|
Note for future: how to run tests is not documented anywhere at the moment? |
archivehaze
left a comment
There was a problem hiding this comment.
I'm happy with this PR, thank you for adding the workflows and changing the tests so they run under tortoise orm. Just one question, did you add the changes that we discussed about the error message when attempting to edit a message that the bot didn't send? Also, is the check to see if they manage the guild necessary? As far as I'm aware, that checks if the user is an admin, but won't the admins also have the moderator role?
Add bot self-message checks inside context menu callbacks.
Remove unnecessary tests, and add new tests for ensuring non-bot messages are met with the correct response.
|
Thanks for the comments! Addressing each point:
Turns out I managed to delete the code that actually registers the context menu commands to the command tree. That's added back in now, but there were hiccups in the checks I had implemented for this. I've now shifted this validation logic inside the callback, and it should work as you described above.
From my understanding, this ensures that the command works when invoked by an admin, even if they happen to be missing the moderator role. This reflects the logic in def staff_command():
return commands.check_any(commands.check(is_moderator), admin_command())Unless there is a need to change this, I think that this fallback behavior is what is preferred/expected. |
Addresses #9, along with other changes. Notable changes include:
&sendfor sending arbitrary messages, including those with embeds.&editfor editing an existing bot message, including those with embeds.&embedrawlegacy command, which sends warnings and updated JSON syntax when invoked.