General notes
BaseCog = getattr(commands, "Cog", object)
was a compatibilty line from a while back and is unneeded now. These days you can use class ClassName(commands.Cog):
.
Usually commands are one word that don’t include underscores. Some of your command names have underscores. Same idea on your cogs, usually cog names don’t include underscores.
A lot of your cogs don’t include an install message, where you can tell users about cog functions or things they should know about, before they load the cog.
The “cog_name” in your Config initializations is not needed in most cases.
While this is a lot of information about your cogs, the most glaring issues that I recommend fixing are:
- Attribution on the insult cog
- Removing the blocking time.sleep on the outofcontext cog and sarcasm cog
- Removing the blocking calls on the Stonks cog
- Adding an upper bound to the weave cog/command so that large numbers don’t block the bot
Alot
The alot install message is sort of vague: Loads in local image instead of linking.
io
, Config
, checks
, are not used in your alot cog.
I was not able to load your alot cog.
C:\joker\cogs\CogManager\cogs\alot\__init__.py:1 in <module>
> 1 from .alot import Alot
C:\joker\cogs\CogManager\cogs\alot\alot.py:5 in <module>
> 5 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\alot\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
AutoReact
autoreact has no install message.
You may want to explain in the [p]autoreact channel docstring that leaving [emojis...]
blank will remove emoji autoreacts for the given channel as I had to read the code to find this out.
[p]autoreact msg says “Set a list of emoji to react with” in the docstring. You may want to explain that this command reacts to the user you specify with the message you provide here as it does not react with emojis in this case.
https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/autoreact/autoreact.py#L186 doesn’t check for add_reaction permissions and can error out.
You may want to check if a user is a bot when setting an autoreact as it gives a success message but then the cog does not react as you check for bot users on the on_message (channel_handler).
Battle
battle is not listed in your README. It seems like from the things I will mention below, that this is a hardcoded cog specifically for one server. If so, you may want to explain this in the install message, or hide the cog using the appropriate entries in your info.json file.
battle does not load - ModuleNotFoundError: No module named 'pony'
. Include this dependency in your info.json in the requirements
tag. Refer to Publishing cogs for Red V3 — Red - Discord Bot 3.4.14 documentation for help with this.
https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/battle/battle.py#L223 could cause unintended interactions if the guild name includes “cortex”. Unlikely but wanted to mention this.
https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/battle/battle.py#L228 if this was meant to refer to a bot’s prefix (the message starting with .
) you may want to change this so that other prefixes work.
https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/battle/battle.py#L240 this also could lead to unintended interactions.
The attack
command on a fresh install errored out for me.
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\battle\battle.py:486 in attack
> 486 target_protected = PROTECTIONS.get(user.id)
AttributeError: 'NoneType' object has no attribute 'id'
The elevate
command has no confirmation message, or consider using ctx.tick().
Most command docstrings in this cog are not accurate for what the command is doing.
There doesn’t seem to be a way to unprotect a user.
There could be other issues in this cog that I missed, but I will be stopping the review of this cog here as it seems incomplete.
BigName
On bigname, you are printing an exception on line 15. Consider using the logging module for this instead so that it can be caught by users that refer to their logs to check for errors. Prints will not show up on logs. This print is also vague, users will not know what cog this error is coming from.
Consider checking for change nickname perms instead of using a try except with a bare exception.
You should add a docstring to the big_name
command so that users know what it does.
BigText
In big_text, you import re but you don’t use it.
Clone
Consider making the role name settable and not hardcoded.
The set_color command doesn’t have a docstring. You should also let users know you are expecting a hex code string for the settable color.
You do not check for permissions needed before trying to execute the role color change with set_color in https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/clone/clone.py#L58
Same thing regarding https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/clone/clone.py#L30
Consider using logging instead of prints.
Consider having more of an explanation on https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/clone/clone.py#L21: What role are you talking about? I know as I’m reviewing that it’s the “snek role” that you’re intending but the ambiguity can be confusing to users.
DMRole
You should have an install warning on this cog, and possibly in the docstring for the command, that warns people about Discord API abuse that is possible with this cog. Also, their bot may be banned from the API by DMing too many people at once.
The assumed fuzzy matching on this cog could lead to DMing people in another role, especially with a low match number like 50. Perhaps consider adding a yes/no prompt with the role that it found. This can be achieved by using the yes/no MessagePredicate helper in Red.
EventConfig
econf has no docstring.
econf disable, econf enable, and econf timeout have no docstrings.
Consider making econf show send 1 message instead of 4+ messages at once.
You assume that a server will have a channel named “general” for your whitelist, which may not be the case.
econf enable and econf disable have no confirmation message. Consider using ctx.tick() or sending a confirmation message after setting the config.
After reading and using this cog, I’m not quite sure what it does. It claims in the info.json that it handles on_message events for your cogs, but I don’t see many references to it in other cogs of yours. Consider adding an install message that explains this cog, or another way that makes it easier for users to understand when to install this cog and how to use it.
Events
This cog would not load when I tried it.
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1356 in load_extension
> 1356 lib = spec.loader.load_module()
<frozen importlib._bootstrap_external>:462 in _check_name_wrapper
<frozen importlib._bootstrap_external>:962 in load_module
<frozen importlib._bootstrap_external>:787 in load_module
<frozen importlib._bootstrap>:265 in _load_module_shim
<frozen importlib._bootstrap>:702 in _load
<frozen importlib._bootstrap>:671 in _load_unlocked
<frozen importlib._bootstrap_external>:783 in exec_module
<frozen importlib._bootstrap>:219 in _call_with_frames_removed
C:\joker\cogs\CogManager\cogs\events\__init__.py:1 in <module>
> 1 from .events import Events
C:\joker\cogs\CogManager\cogs\events\events.py:13 in <module>
> 13 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\events\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
I noticed this has “hidden”: true in the info.json so don’t pay attention too much to this part of the review.
ExportEmoji
https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/export_emoji/export_emoji.py#L110 just fyi, sticker support is in d.py 2.0, which Red doesn’t totally support yet, we’re working on it. message.stickers returns an empty list in dpy 1.7.x.
Using the export command with a snowflake id, or any other non-message id causes the command to error out as there’s not a catch for NotFound.
ERROR Exception in command 'export'
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\export_emoji\export_emoji.py:52 in export
> 52 message: discord.Message = await ctx.message.channel.fetch_message(
c:\envs\joker3.4\lib\site-packages\discord\abc.py:1132 in fetch_message
> 1132 data = await self._state.http.get_message(channel.id, id)
c:\envs\joker3.4\lib\site-packages\discord\http.py:250 in request
> 250 raise NotFound(r, data)
NotFound: 404 Not Found (error code: 10008): Unknown Message
There isn’t a catch if the zip file ends up being over 8mb. I tried to hit this with a 4000 character nitro message and came somewhat close - 7.4mb. If more of the emojis were animated, it may have gone over 8mb.
You may want to add ctx.typing() to the export command as the above test took a while for the bot to gather all of the images.
Facts
Both bundled text files were not able to be read, so the cog cannot be loaded.
ERROR Package loading failed
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1365 in load_extension
> 1365 lib.setup(self)
C:\joker\cogs\CogManager\cogs\facts\__init__.py:5 in setup
> 5 bot.add_cog(Fact(bot))
C:\joker\cogs\CogManager\cogs\facts\facts.py:21 in __init__
> 21 self.bearfacts: List[str] = (data_dir / "bearfacts.txt").read_text().split("\n")
C:\Program Files (x86)\Python38-32\lib\pathlib.py:1233 in read_text
> 1233 return f.read()
C:\Program Files (x86)\Python38-32\lib\encodings\cp1252.py:23 in decode
> 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0]
bearfacts.txt:
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 5690: character maps to
snekfacts.txt:
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 14195: character maps to
There are also no docstrings in this cog, but you have a comment in the file saying so, so you know about this one.
Fires
You have aiohttp
, discord
, data_manager
and io
imported but you don’t use them.
GoodBot
You have a function called getuser
that seems to require your whois cog to be loaded to use, but you don’t use the getuser function anywhere in the cog. You should also warn users that this cog requires the whois cog to be loaded for extra functionality, if you decide to use that getuser function in this cog in the future.
Using allratings
with an empty list/no ratings causes a traceback.
ERROR Exception in command 'allratings'
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\goodbot\goodbot.py:260 in allratings
> 260 await menu(ctx, pages, DEFAULT_CONTROLS)
c:\envs\joker3.4\lib\site-packages\redbot\core\utils\menus.py:59 in menu
> 59 if not isinstance(pages[0], (discord.Embed, str)):
IndexError: list index out of range
There’s no catch in this cog for someone adding emojis to their own messages - it still counts as a valid emoji use in the ratings list.
You can use @commands.Cog.listener() on your parse_reaction_add and parse_reaction_remove functions to make them listeners instead of adding them through the cog’s init.
Haiku
This cog cannot be loaded.
ERROR Package loading failed
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1356 in load_extension
> 1356 lib = spec.loader.load_module()
<frozen importlib._bootstrap_external>:462 in _check_name_wrapper
<frozen importlib._bootstrap_external>:962 in load_module
<frozen importlib._bootstrap_external>:787 in load_module
<frozen importlib._bootstrap>:265 in _load_module_shim
<frozen importlib._bootstrap>:702 in _load
<frozen importlib._bootstrap>:671 in _load_unlocked
<frozen importlib._bootstrap_external>:783 in exec_module
<frozen importlib._bootstrap>:219 in _call_with_frames_removed
C:\joker\cogs\CogManager\cogs\haiku\__init__.py:1 in <module>
> 1 from .haiku import Haiku
C:\joker\cogs\CogManager\cogs\haiku\haiku.py:15 in <module>
> 15 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\haiku\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
Also not sure why you have https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/haiku/haiku.py#L137 and line 138 in this cog.
HotelCalifornia
None of the commands have docstrings.
ImDad
This cog cannot be loaded.
ERROR Package loading failed
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1356 in load_extension
> 1356 lib = spec.loader.load_module()
<frozen importlib._bootstrap_external>:462 in _check_name_wrapper
<frozen importlib._bootstrap_external>:962 in load_module
<frozen importlib._bootstrap_external>:787 in load_module
<frozen importlib._bootstrap>:265 in _load_module_shim
<frozen importlib._bootstrap>:702 in _load
<frozen importlib._bootstrap>:671 in _load_unlocked
<frozen importlib._bootstrap_external>:783 in exec_module
<frozen importlib._bootstrap>:219 in _call_with_frames_removed
C:\joker\cogs\CogManager\cogs\im_dad\__init__.py:1 in <module>
> 1 from .imdad import ImDad
C:\joker\cogs\CogManager\cogs\im_dad\imdad.py:6 in <module>
> 6 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\im_dad\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
I’m not sure why you have https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/im_dad/imdad.py#L9 and then you’re redefining it in your cog init.
self.lock_config
is used in this cog but it’s not declared anywhere.
Instead of adding a listener in the init, consider using @commands.Cog.listener() on the listener function.
IMDBLookup
Consider adding ctx.typing() to the movie and person lookup as the command response is not instant.
You import data_manager
but you don’t use it.
Consider using the logging module instead of print().
https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/imdb_lookup/imdblookup.py#L87 and the following lines are not needed.
There were lib errors while I tested this cog as well. I looked up a movie and a person:
2021-10-08 10:31:21,258 ERROR [imdbpy] C:\joker\cogs\Downloader\lib\imdb\__init__.py:783: unknown information set "summary"
[10:31:21] ERROR unknown information set "summary"
[imdbpy] 2021-10-08 10:31:21,477 ERROR [imdbpy] C:\joker\cogs\Downloader\lib\imdb\__init__.py:783: unknown information set "cast"
ERROR unknown information set "cast"
[imdbpy] 2021-10-08 10:31:21,493 ERROR [imdbpy] C:\joker\cogs\Downloader\lib\imdb\__init__.py:783: unknown information set "rating"
ERROR unknown information set "rating"
[imdbpy] 2021-10-08 10:31:21,493 ERROR [imdbpy] C:\joker\cogs\Downloader\lib\imdb\__init__.py:783: unknown information set "runtime"
ERROR unknown information set "runtime"
Insult
This cog cannot be loaded.
ERROR Package loading failed
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1365 in load_extension
> 1365 lib.setup(self)
C:\joker\cogs\CogManager\cogs\insult\__init__.py:5 in setup
> 5 bot.add_cog(Insult(bot))
C:\joker\cogs\CogManager\cogs\insult\insult.py:19 in __init__
> 19 insults = (data_dir / "insults.txt").read_text().split("\n")
C:\Program Files (x86)\Python38-32\lib\pathlib.py:1233 in read_text
> 1233 return f.read()
C:\Program Files (x86)\Python38-32\lib\encodings\cp1252.py:23 in decode
> 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 31834: character maps to <undefined>
This cog also looks pretty similar to Trusty’s v2 and v3 insult cogs. You should give him attribution if you took this from him, or to the original v2 cog authors (Airenkun, JennJenn) if you ported this cog from older v2 stuff before Trusty did.
JustMetHer
This cog cannot be loaded.
ERROR Package loading failed
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1356 in load_extension
> 1356 lib = spec.loader.load_module()
<frozen importlib._bootstrap_external>:462 in _check_name_wrapper
<frozen importlib._bootstrap_external>:962 in load_module
<frozen importlib._bootstrap_external>:787 in load_module
<frozen importlib._bootstrap>:265 in _load_module_shim
<frozen importlib._bootstrap>:702 in _load
<frozen importlib._bootstrap>:671 in _load_unlocked
<frozen importlib._bootstrap_external>:783 in exec_module
<frozen importlib._bootstrap>:219 in _call_with_frames_removed
C:\joker\cogs\CogManager\cogs\just_met_her\__init__.py:1 in <module>
> 1 from .justmether import JustMetHer
C:\joker\cogs\CogManager\cogs\just_met_her\justmether.py:6 in <module>
> 6 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\just_met_her\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
Not sure why you are doing https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/just_met_her/justmether.py#L9 when you just redefine it later.
Instead of adding a listener in the init, consider using @commands.Cog.listener() on the listener function.
Minesweeper
The msnew command does not have a docstring.
You can enter in invalid numbers to msnew, like negative numbers.
Lines including and after https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/minesweeper/minesweeper.py#L231 are not needed.
You import pprint but you never use it.
Move
The move command has no docstring.
You import utils
but you don’t use it.
There is no check for permissions on the message deletion on https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/move/move.py#L40
ERROR Exception in command 'move'
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\move\move.py:40 in move
> 40 await message.delete()
c:\envs\joker3.4\lib\site-packages\discord\message.py:1023 in delete
> 1023 await self._state.http.delete_message(self.channel.id, self.id)
c:\envs\joker3.4\lib\site-packages\discord\http.py:248 in request
> 248 raise Forbidden(r, data)
Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
There is no check for if a bot can view a target channel or not, leading to a traceback.
ERROR Exception in command 'move'
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\move\move.py:34 in move
> 34 await new_channel.send(content)
c:\envs\joker3.4\lib\site-packages\discord\abc.py:1065 in send
> 1065 data = await state.http.send_message(channel.id, content, tts=tts,
embed=embed,
c:\envs\joker3.4\lib\site-packages\discord\http.py:248 in request
> 248 raise Forbidden(r, data)
Forbidden: 403 Forbidden (error code: 50001): Missing Access
NickPrefix
Consider using logging instead of printing your exceptions. Printing provides no information to the user as to where the issue is and is not logged besides just the visual message on the console.
You do not check for the bot having permissions to change a user’s nickname. This can be done with either command decorators or by checking within the command and providing a user-friendly explanation of permissions needed.
NoFuckYou
This cog would not load when I tried it.
ERROR Package loading failed
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1356 in load_extension
> 1356 lib = spec.loader.load_module()
<frozen importlib._bootstrap_external>:462 in _check_name_wrapper
<frozen importlib._bootstrap_external>:962 in load_module
<frozen importlib._bootstrap_external>:787 in load_module
<frozen importlib._bootstrap>:265 in _load_module_shim
<frozen importlib._bootstrap>:702 in _load
<frozen importlib._bootstrap>:671 in _load_unlocked
<frozen importlib._bootstrap_external>:783 in exec_module
<frozen importlib._bootstrap>:219 in _call_with_frames_removed
C:\joker\cogs\CogManager\cogs\no_fuck_you\__init__.py:1 in <module>
> 1 from .no_fuck_you import NoFuckYou
C:\joker\cogs\CogManager\cogs\no_fuck_you\no_fuck_you.py:5 in <module>
> 5 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\no_fuck_you\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
You import data_manager
but don’t use it.
Instead of adding a listener in the init, consider using @commands.Cog.listener() on the listener function.
https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/no_fuck_you/no_fuck_you.py#L9 is redundant as you redefine it later.
OutOfContext
ooc has no docstring.
Using penny
gave me an error as there was nothing to choose from:
ERROR Exception in command 'penny'
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\out_of_context\outofcontext.py:133 in penny
> 133 reply = await self.get_quote(ctx, most_recent=False)
C:\joker\cogs\CogManager\cogs\out_of_context\outofcontext.py:144 in get_quote
> 144 reply = random.choice(quotes)
C:\Program Files (x86)\Python38-32\lib\random.py:290 in choice
> 290 raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence
Consider using pagify on ooc show
instead of just telling people it will error out with too large of a message.
Your docstring for ooc update
shows a command that doesn’t exist: Usage: [p]update_ooc
Consider adding ctx.typing() to ooc update
as it’s an operation that takes quite a while (gathering message content) and it provides no user feedback to let the user know it’s working on the command.
Your ooc download
docstring is copied from ooc remove
and not changed to reflect what the command will do.
time.sleep is blocking, use asyncio.sleep instead
Quotes
This cog can’t be loaded.
ERROR Package loading failed [red]
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1365 in load_extension
> 1365 lib.setup(self)
C:\joker\cogs\CogManager\cogs\quotes\__init__.py:5 in setup
> 5 bot.add_cog(Quotes(bot))
C:\joker\cogs\CogManager\cogs\quotes\quotes.py:21 in __init__
> 21 (data_dir / "prompts.json").read_text()
C:\Program Files (x86)\Python38-32\lib\pathlib.py:1233 in read_text
> 1233 return f.read()
C:\Program Files (x86)\Python38-32\lib\encodings\cp1252.py:23 in decode
> 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0]
┘
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 84: character maps to <undefined>
You should let users know that this cog interacts with your whois cog.
RockAndStone
This cog can’t be loaded.
ERROR Package loading failed [red]
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1356 in load_extension
> 1356 lib = spec.loader.load_module()
<frozen importlib._bootstrap_external>:462 in _check_name_wrapper
<frozen importlib._bootstrap_external>:962 in load_module
<frozen importlib._bootstrap_external>:787 in load_module
<frozen importlib._bootstrap>:265 in _load_module_shim
<frozen importlib._bootstrap>:702 in _load
<frozen importlib._bootstrap>:671 in _load_unlocked
<frozen importlib._bootstrap_external>:783 in exec_module
<frozen importlib._bootstrap>:219 in _call_with_frames_removed
C:\joker\cogs\CogManager\cogs\rock_and_stone\__init__.py:1 in <module>
> 1 from .rock_and_stone import RockAndStone
C:\joker\cogs\CogManager\cogs\rock_and_stone\rock_and_stone.py:5 in <module>
> 5 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\rock_and_stone\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
Instead of adding a listener in the init, consider using @commands.Cog.listener() on the listener function.
RoleRequest
You import data_manager
but you never use it.
Instead of adding a listener in the init, consider using @commands.Cog.listener() on the listener function.
The role
command has no docstring.
pass_context=True
is not needed in v3 cogs.
There is no checking for permissions needed for adding and removing roles from a user.
Ignoring exception in on_raw_reaction_remove
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\rolerequest\rolerequest.py", line 73, in remove_role_from_user
await user.remove_roles(role)
File "c:\envs\joker3.4\lib\site-packages\discord\member.py", line 822, in remove_roles
await req(guild_id, user_id, role.id, reason=reason)
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
Ignoring exception in on_raw_reaction_add
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\rolerequest\rolerequest.py", line 49, in add_role_to_user
await user.add_roles(role)
File "c:\envs\joker3.4\lib\site-packages\discord\member.py", line 777, in add_roles
await req(guild_id, user_id, role.id, reason=reason)
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
There’s no permissions checking on https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/rolerequest/rolerequest.py#L107 or on https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/rolerequest/rolerequest.py#L132
Sarcasm
The cog cannot be loaded.
ERROR Package loading failed
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1356 in load_extension
> 1356 lib = spec.loader.load_module()
<frozen importlib._bootstrap_external>:462 in _check_name_wrapper
<frozen importlib._bootstrap_external>:962 in load_module
<frozen importlib._bootstrap_external>:787 in load_module
<frozen importlib._bootstrap>:265 in _load_module_shim
<frozen importlib._bootstrap>:702 in _load
<frozen importlib._bootstrap>:671 in _load_unlocked
<frozen importlib._bootstrap_external>:783 in exec_module
<frozen importlib._bootstrap>:219 in _call_with_frames_removed
C:\joker\cogs\CogManager\cogs\sarcasm\__init__.py:1 in <module>
> 1 from .sarcasm import Sarcasm
C:\joker\cogs\CogManager\cogs\sarcasm\sarcasm.py:7 in <module>
> 7 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\sarcasm\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
Config is imported, but not used.
Say
pprint and random.choice are imported but not used.
Reading and saving all guild and all channels in memory can be a bit problematic, this implementation made me raise an eyebrow in thinking about large bots with thousands of guilds/channels available.
The say command needs to check for permissions.
ERROR Exception in command 'say'
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\say\say.py:43 in say
> 43 await channel.send(what_to_say)
c:\envs\joker3.4\lib\site-packages\discord\abc.py:1065 in send
> 1065 data = await state.http.send_message(channel.id, content, tts=tts,
embed=embed,
c:\envs\joker3.4\lib\site-packages\discord\http.py:248 in request
> 248 raise Forbidden(r, data)
Forbidden: 403 Forbidden (error code: 50001): Missing Access
There is a fuzzy match for guild name and channel name without any confirmation, possibly leading to a message send to the wrong guild or channel.
pass_context=True is not needed in v3 cogs.
Search
The google
command docstring is a copy of the Wolfram Alpha one.
Consider using the Wolfram API point that returns one image instead of ctx.send’ing 6+ images when wolfram is used, or use the text endpoint. See my wolfram cog on my repo for examples.
The Discord link unfurler seemed to not like a url with non-english characters (test search was “montaña de oro”), and just displayed a picture instead of picture + text. (Not much you can do here, but wanted to report it/let you know).
There’s an import for Red’s menus and pagify, but you don’t use either.
Spoop
This cog did not load.
ERROR Package loading failed
c:\envs\joker3.4\lib\site-packages\redbot\core\core_commands.py:173 in _load
> 173 await bot.load_extension(spec)
c:\envs\joker3.4\lib\site-packages\redbot\core\bot.py:1356 in load_extension
> 1356 lib = spec.loader.load_module()
<frozen importlib._bootstrap_external>:462 in _check_name_wrapper
<frozen importlib._bootstrap_external>:962 in load_module
<frozen importlib._bootstrap_external>:787 in load_module
<frozen importlib._bootstrap>:265 in _load_module_shim
<frozen importlib._bootstrap>:702 in _load
<frozen importlib._bootstrap>:671 in _load_unlocked
<frozen importlib._bootstrap_external>:783 in exec_module
<frozen importlib._bootstrap>:219 in _call_with_frames_removed
C:\joker\cogs\CogManager\cogs\spoop\__init__.py:1 in <module>
> 1 from .spoop import Spoop
C:\joker\cogs\CogManager\cogs\spoop\spoop.py:5 in <module>
> 5 from .eris_event_lib import ErisEventMixin
C:\joker\cogs\CogManager\cogs\spoop\eris_event_lib.py:1
../eris_event_lib.py
▲
SyntaxError: invalid syntax
Instead of adding a listener in the init, consider using @commands.Cog.listener() on the listener function.
You’re not checking for blocked DMs on https://github.com/TheDataLeek/Eris-Cogs/blob/e02ecbd68956992ed09228bbedcfb26890992b23/spoop/spoop.py#L74