JojoCogs

Discord Name:
Jojo#7791
GitHub Repository (Must be V3):
https://github.com/Just-Jojo/JojoCogs
Description:

A collection of fun and useful cogs for Red V3. This includes a todo list for keeping track of projects and other utility cogs for bot owners

2 Likes

Hi Jojo, thanks for your patience while I reviewed your repo. None of these are very critical besides perhaps the interaction I listed between AdvancedBlacklist and ErrorBlacklist, under the ErrorBlacklist section.

AdvancedBlacklist

  • format_help_for_context needs an extra backtick in the authors line, to complete the string format.

  • Your converters.py seems to suggest that if I try to blacklist a bot owner, bot, or myself, there should be a friendly message returned, but instead it just provides the command help to the user instead. This also occurs on trying to whitelist a bot.

  • The arg β€œusers” is described as β€œuser” in the command docstring for [p]blacklist add, [p]whitelist add, [p]localblacklist add, [p]localwhitelist add, [p]blacklist remove, [p]localblacklist remove

AdvancedInvite

  • Cool little buttons implementation without having to install other packages.

  • You may want to put some information in the class help or command help that directs people to try to use [p]invite settings as I had to look through the code to find the invite settings.

  • Consider suggesting a public way/PRing a public way to access the β€œinvite_commands_scope” setting in core Red instead of reading from the private Config attribute for the bot in the _invite_url function.

Note that for the following points, I had an existing settings.json from this cog when I previously tested it a few months ago, in case that matters:

  • [p]invite set footer doesn’t seem to set a footer for me when using the [p]invite command.

  • The footer text set could be displayed in the invite settings embed as it’s not at the moment (seeing that you use .all() for settings display, maybe there’s something going on there)

  • The [p]invite set embed toggle seems to not work for me - the message is always sent as an embed.

  • [p]invite set public could use a describing definition for toggle, like you have in [p]invite set embed

AdvancedLog

  • Very minor and not really important, but the β€œNote” header on [p]modnote list is not lined up with the content (note text is 5 spaces ahead of the Note header)

CmdLogger

  • Consider checking for perms on sending messages to the command logger channel.
Ignoring exception in on_command_completion
Traceback (most recent call last):
  File "C:\joker\cogs\CogManager\cogs\cmdlogger\core.py", line 181, in on_command_completion
    await self.log_channel.send(msg)
  File "c:\envs\joker3.4\lib\site-packages\discord\abc.py", line 1065, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
  File "c:\envs\joker3.4\lib\site-packages\discord\http.py", line 248, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\envs\joker3.4\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\joker\cogs\CogManager\cogs\cmdlogger\core.py", line 183, in on_command_completion
    log.warning(f"I could not send a message to channel '{channel.name}'")
UnboundLocalError: local variable 'channel' referenced before assignment
  • Using a command name that doesn’t exist with [p]cmdlogger delete or [p]cmdlogger add will cause a traceback
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────┐
β”‚ c:\envs\joker3.4\lib\site-packages\discord\ext\commands\core.py:85 in wrapped                                                                                                                β”‚
β”‚ >   85             ret = await coro(*args, **kwargs)                                                                                                                                         β”‚
β”‚ C:\joker\cogs\CogManager\cogs\cmdlogger\core.py:112 in cmd_add                                                                                                                               β”‚
β”‚ > 112         cmd = command.qualified_name                                                                                                                                                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 
AttributeError: 'NoneType' object has no attribute 'qualified_name'

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────┐
β”‚ c:\envs\joker3.4\lib\site-packages\discord\ext\commands\core.py:85 in wrapped                                                                                                                β”‚
β”‚ >   85             ret = await coro(*args, **kwargs)                                                                                                                                         β”‚
β”‚ C:\joker\cogs\CogManager\cogs\cmdlogger\core.py:131 in cmd_remove                                                                                                                            β”‚
β”‚ > 131         cmd = command.qualified_name                                                                                                                                                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 
AttributeError: 'NoneType' object has no attribute 'qualified_name'
  • Possibly add a link to the [p]cmdlogger delete message for: If this command is being tracked, please make an issue on my github or some other way to let the owner know what to do (they may have forgotten your gh by the time they try to use this command this way)

CycleStatus

  • Consider implementing a status length to [p]status add - setting a very long status will show no status when that status comes around

Depypher

Pretty straighforward, no comments here

ErrorBlacklist

  • I have AdvancedBlacklist loaded alongside ErrorBlacklist, and I set up an β€œerror” command that would raise a NotImplementedError and after using mock to mock a user using it to the [p]errorblacklist amount limit, there was a recursion error in AdvancedBlacklist:
Ignoring exception in on_command_error
Traceback (most recent call last):
  File "c:\envs\joker3.4\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\joker\cogs\CogManager\cogs\errorblacklist\errorblacklist.py", line 378, in on_command_error
    await add_to_blacklist(self.bot, {user})
  File "c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py", line 550, in add_to_blacklist
    await self._whiteblacklist_cache.add_to_blacklist(guild, to_add)
  File "C:\joker\cogs\CogManager\cogs\advancedblacklist\monkey.py", line 23, in add_to_blacklist
    d = await _FUNCS[0](self, guild, role_or_user)
  File "C:\joker\cogs\CogManager\cogs\advancedblacklist\monkey.py", line 23, in add_to_blacklist
    d = await _FUNCS[0](self, guild, role_or_user)
  File "C:\joker\cogs\CogManager\cogs\advancedblacklist\monkey.py", line 23, in add_to_blacklist
    d = await _FUNCS[0](self, guild, role_or_user)
  [Previous line repeated 983 more times]
RecursionError: maximum recursion depth exceeded

Unloading AdvancedBlacklist did not unload the monkeypatch, and I had to restart the bot to continue testing this command (the mock error worked fine after the restart/not having AB loaded)

  • [p]errorblacklist whitelist add’s docstring has β€œitme” in it, which I’m not quite sure what that is based on the other instructions/docstrings

Thanks for taking the time to review my cogs :smiley:

For AdvancedBlacklist and ErrorBlacklist, I have recently rewritten AdvancedBlacklist so these problems should be fixed.

For AdvancedInvite I fixed the embed issue, added the footer to the invite command, and made the cog’s docstring point to [p]invite set's existence. As for the invite_commands_scope this is purely for backwards compatibility and as such, I don’t think it would benefit from having a new method added to Red.

For CmdLogger I fixed the UnboundLocalError in the listener and the AttributeError in the remove command, I also added a reference to my github page for reporting issues.

For CycleStatus I implemented a maximum length for statuses.

Once again, thank you for reviewing my cogs :slightly_smiling_face: