This one took me a little longer to review. I don’t own minecraft, so I can’t grab an API key for the hypixel server to just verify basic behavior.
There aren’t any problematic parts in how it interacts with discord or other bot functions, and the interaction with hypixel’s API seem to be fine looking at the lib used and expected return values from them.
L108-109: change this to
pass to use the auto help.
L55-56 & L95-86:
for channel in guild.channels:
if isinstance(channel, (discord.VoiceChannel, discord.TextChannel)):
This can be changed to:
for channel in (*guild.text_channels, *guild.voice_channels):
# and an unindent
to avoid the overhead of calling
isinstance on each of the channels (generator creation is cheaper than even one
L67, related L97:
early termination here on partial missing perms is problematic. It has the potential to partially lock down the server without recording that it did so, making it impossible to revert with the corresponding command to end the lockdown.
I recommend changing the logic here to check that you have the perms required to do this in each channel prior to even starting.
Keep in mind when designing such a check that the API does not let you edit a channels overwrites in a way which would remove access from yourself.
The other option would be to allow it to continue past channels where it could not perform the change, and inform the person invoking which channels could not be locked down.
again, dont own minecraft. also again, no major issues. There may be an issue with how this interacts with the API, but this appears to be mostly fine. At the very least, it’s not going to break on the discord side of things.
L: 162-163: replace with
pass to use auto help
Outright broken, wont load.
L5: you’re passing bot to a cog not expecting it in it’s init
L6: redundant listener addition, this one should be handled automaticallly
missing cog18n decorator (yes, I know it’s being removed soon, current version still needs it)
Suggest to eventually migrate to red’s menu util for consistency with main both behavior, but not requied.
missing an import (
discord) being used for error handling
L72-73: swap these for just
pass for auto help use.
potentially use red’s menu util (not required)
menus.py : consider red’s menu util for future (optional)
autohelp=False in the group decorator to retain your custom handling without double sending the help message.
That wraps up my review (until changes are made) Again, if there are any questions, feel free to ask anything here or DM on discord.