Commit hash: 82db77db3f1b2a282df3e00df8ea2b0e6885d0e2
Red v3.1.4
Consider anything prefaced with “You might want” to be optional
General
-You have multiple unnecessary folders in your repo (.idea
, .vscode/.ropeproject
, and msg_ctrl/__pycache__
).
-You might want to make your cogs follow the typical naming scheme of cogs and commands (typically cogs and commands do not have underscores).
-You might want to have a license for your cogs.
-You do not have install instructions in your readme.
-You are missing some keys from your cog info.jsons.
Chat_Ctrl
-You do not have a class doc string, so [p]help Chat_Ctrl
does not have a cog description.
-Technically, it is not image only as any attachment is able to be sent, and text can be sent with an attachment.
-The menu system you have in the command can be removed with proper use of subcommands and parameters. Making the current command into a group command with subcommands like “add” and “list” would simplify the process.
-The menu does not give enough time to read and mentally process what it is saying.
-Showing the current image only channels just outputs a raw list of channel IDs.
-There is no way to stop a channel from being image only.
-list_img_only_channels
is never called.
-The command requires red’s mod role (the lower of the two red roles) or administrator (the highest discord permission).
-You check that len(message.attachments)<1
rather than len(message.attachments) == 1
(or even better, not message.attachments
).
-add_img_only_channel
's “docstring” states it can accept an ID or string (name), however it only accepts discord.TextChannel.
-You do not check that the channel is the same as ctx.channel
when waiting for messages, so responding in any server the bot can see (from the same person) will count.
-DMing the bot posts an error to console because the on_message
does not check if the message was sent in a guild before doing self.database.guild(message.guild).Only_Image_Channels()
:
Traceback (most recent call last):
File "<datapath>\cogs\CogManager\cogs\chat_ctrl\chat_ctrl.py", line 17, in on_message
async with self.database.guild(message.guild).Only_Image_Channels() as only_image_channels:
File "path\to\venv\lib\site-packages\redbot\core\config.py", line 881, in guild
return self._get_base_group(self.GUILD, str(guild.id))
AttributeError: 'NoneType' object has no attribute 'id'
-Sending an invalid message in an image only channel when the bot does not have permission to delete messages posts an error to console:
Traceback (most recent call last):
File "<datapath>\cogs\CogManager\cogs\chat_ctrl\chat_ctrl.py", line 20, in on_message
await message.delete()
discord.errors.Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions
-Many things are considered valid under .is_digit
that are not valid for int()
. Your get_int_choice
errors when such a value is presented (such as a ^2 symbol):
Exception in command 'img_only'
Traceback (most recent call last):
File "<datapath>\cogs\CogManager\cogs\chat_ctrl\chat_ctrl.py", line 53, in img_only
choice = await self.get_int_choice(ctx, "What do you want to do?\n1. List all image only channels.\n2. Add a new image only channel.")
File "<datapath>\cogs\CogManager\cogs\chat_ctrl\chat_ctrl.py", line 89, in get_int_choice
return int(choice.content)
ValueError: invalid literal for int() with base 10: '²'
Countdown_Tagger
This cog is so broken, I cannot even tell what it is supposed to be doing. This isn’t a full review by any means, this is just as far as I could tell. Please fix this cog and explain what it is supposed to do.
-You do not have a class doc string, so [p]help Countdown_Tagger
does not have a cog description.
-message
and date
could probably be parameters instead of interactive responses.
-This cog does not appear to allow you to set a specific time for events (only a date), and appears to only allow one event at once.
-At 10PM EST, I attempted to set the date for the next day, however it did not accept it, saying that date already passed. I assume this is a UTC issue.
-You do not need to import commands
in your __init__.py file.
-[p]cd_tag message
is not explained very well at all and it seems to have no checks, so it errors easily:
Traceback (most recent call last):
File "<datapath>\cogs\CogManager\cogs\countdown_tagger\countdown_tagger.py", line 107, in message
send_msg = await self.get_send_msg(gconf)
File "<datapath>\cogs\CogManager\cogs\countdown_tagger\countdown_tagger.py", line 116, in get_send_msg
premiere_date = dateutil.parser.parse(premiere_date_str).replace(tzinfo=None)
TypeError: Parser must be a string or character stream, not NoneType
-Giving an invalid date to cd_tag date
causes an error:
00 00 000:
Traceback (most recent call last):
File "<datapath>\BOT\cogs\CogManager\cogs\countdown_tagger\countdown_tagger.py", line 57, in date
new_date = dateutil.parser.parse(message.content, dayfirst=True)
ValueError: month must be in 1..12
d:
Traceback (most recent call last):
File "<datapath>\BOT\cogs\CogManager\cogs\countdown_tagger\countdown_tagger.py", line 57, in date
new_date = dateutil.parser.parse(message.content, dayfirst=True)
ValueError: ('Unknown string format:', 'd')
OneWordStory
-You do not have a class doc string, so [p]help OneWordStory
does not have a cog description.
-The grammar of [p]ows rules
is not very good.
-The first story I made was story #2.
-The imports of this cog are a complete mess.
-There are lots of comments in the code that are outdated.
-__unload
is no longer valid in the latest versions of red. Use def cog_unload(self):
.
-The command requires red’s mod role (the lower of the two red roles) or administrator (the highest discord permission).
-I don’t think autohelp=True
is needed.
-You do not check that the channel is the same as ctx.channel
when waiting for messages, so responding in any server the bot can see (from the same person) will count.
-Console is spammed with each addition to the story.
-There is no reason for [p]ows gallery set_channel
(or some of the other commands) to be interactive. The same thing can be solved with async def set_channel(self, ctx, channel: discord.TextChannel):
. Please use parameters, they are very nice.
-It appears that the italics of “Words per user:” when starting a new OWS is broken because of a stray space.
-[p]ows settings wordcount
did not work for the first game that I made after changing it (it appeared in the “Words per user:” but not “The number of words per message is”), however it did work in the second game I made after changing it.
-You might want to let people add custom starter phrases.
-You might want to use the user set bot embed color instead of using the bot’s highest role’s color (await ctx.embed_color()
).
-There doesn’t seem to be a way to remove a gallery channel.
-[p]ows start
's errors are hidden because you run it in a task. It can error:
—If the gallery channel is deleted.
—If the bot does not have permission to post to the gallery channel.
—If the bot does not have permission to send embeds.
—If the total length of the story becomes above 2000 characters.
-[p]ows gallery set_channel
errors on timeout:
Traceback (most recent call last):
File "<datapath>\cogs\CogManager\cogs\onewordstory\onewordstory.py", line 219, in set_channel
,check=channelcheck)
concurrent.futures._base.TimeoutError
-[p]ows settings wordcount
errors on timeout:
Traceback (most recent call last):
File "<datapath>\cogs\CogManager\cogs\onewordstory\onewordstory.py", line 127, in wordcount
await ctx.bot.wait_for('message', timeout=7, check=pred)
concurrent.futures._base.TimeoutError
-[p]ows settings counter_reset
errors because you attempt to use async with config
on an int:
Traceback (most recent call last):
File "<datapath>\cogs\CogManager\cogs\onewordstory\onewordstory.py", line 107, in counter_reset
async with self.config.guild(ctx.guild).Counter() as counter:
TypeError: Type of retrieved value must be mutable (i.e. list or dict) in order to use a config value as a context manager.