Spideysimp cogs

Discord Name: spidey.simp

GitHub Repository (Must be V3): https://github.com/spidey-simp/spideysimp-cogs

Description: So far, I only have one cog, but I am planning to create so many more in the future! Thank you for the opportunity to upload them!

Thank you for your patience. Due to the current backlog of CC applications and the number of cogs in your repo, I am only going to review a small subset of the cogs in this repo for an initial review. Please make the required changes to the reviewed cogs, and review the remaining cogs for similar issues. This will hopefully allow an expedited review of the remaining cogs, and will be good practice for maintaining best practices in any future cogs you develop. You may also want to review the approved CC requirements while you apply your changes to ensure all your cogs meet all of the requirements.

Please let me know when you have applied the requested changes. I may or may not continue reviewing the remaining cogs prior to that point, but I will need to know when to re-review the cogs from this review either way.


Commit hash: e2ed6a4b305334f8aa91a3d5d988df44b98cb31b
Red v3.5.24
Consider only bullets prefixed with :memo: to be required.


The following cogs have not yet been reviewed: civvirandom, corporations, dictionary, fandomsearch, hoi4random, identitytheft, languify, madlibs, nolinksinnames, smashorpass, spideycasino, spideycourts, spideyeconomy, spideylifesim, spideygov, spideyrandom, spideyresponds, spideyromance, spideyrpg, spideyservertools, spideystocks, spideyutils, thirtyyearswarrp, treasury, whoami, worldofapis

General

  • Consider using a backtick (`) instead of a single quote (') in the example commands in your install_msg info.json field to make them render a little nicer.
  • :memo: Your repo level info.json file is missing the description field.
  • Consider using ctx.prefix in commands [p] is stated to give example commands with the contextually relevant prefix.
  • :memo: Your repository is missing a readme file that contains
    • Repository name
    • Installation instructions
    • Extra setup instructions (if applicable)
    • Credits (if applicable)
  • You may want to go through your cogs for ones that are either not finished or should not be public and either mark them as hidden in their info.json or move them to a separate repo from the one you are seeking approval for.

Goals

  • :memo: This cog is missing an info.json file, which defines various metadata that helps the Red Index and downloader cog explain what your cog does.
    • :memo: This cog does not properly list aiosqlite in its requirements info.json field, so the bot does not automatically install the dependency. This causes an error if the user does not already have the dependency.
  • :memo: This cog has no commands and does nothing but define tables. Should this cog be hidden in its info.json?

SpideyGames

  • :memo: This cog does not properly list wordfreq or nltk in its requirements info.json field, so the bot does not automatically install the dependency. This causes an error if the user does not already have the dependency.
  • :memo: Your games error if the bot does not have embed_links permissions in the channel:
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\spideygames\spideygames.py", line 1838, in uno_create
        message = await ctx.send(embed=game.status_embed(), view=UnoLobbyView(self))
    discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
    
  • The “draw until you find a playable card” logic of Uno auto plays wildcards and auto selects the color for human players. I feel like players would want to be able to select their wild color even when top-decking.
  • I would suggest either hiding or removing the spideygameset command if there are currently no settings to configure.

SpideyNations

  • :memo: This cog is missing an info.json file, which defines various metadata that helps the Red Index and downloader cog explain what your cog does.
  • :memo: The adjustapolicy, nationstatus, setideology, and startpolicytest commands are missing docstrings (despite having the description field of the command decorator), which define the help text for the text version of your commands.
  • :memo: The [p]nationstatus command errors because the output is too long:
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\spideynations\spideynations.py", line 319, in nationstatus
        await ctx.send(status)
    discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
    In content: Must be 2000 or fewer in length.
    
  • [p]adjustapolicy references a command setinitialpolicy that does not exist, and can’t do anything on its own.
  • Commands reference a hardcoded / prefix. This could be OK if the slash version of the commands are enabled and synced, but might be somewhat confusing if that is not the case.
    • You can check ctx.interaction is not None to know if the invocation of a hybrid command was done using a slash command.
  • :memo: This cog seems to be missing a large amount of the functionality it would need to have the kind of cascading interactions and user input that would make it behave in an interesting way. Is it unfinished? Should it be marked as hidden in its info.json?
  • :memo: The nations.json file should not be stored in a relative path (which depends on how the bot was started), and should be stored within cog_data_path instead.
    • Also consider storing in Config.

StatusSet

  • :memo: This cog is missing an info.json file, which defines various metadata that helps the Red Index and downloader cog explain what your cog does.
    • Currently this cog has no commands and simply rotates the bot’s status through random Spiderman related statuses every 3 hours. If the info.json properly explains this, that is fine, however I’m not sure if this is a generally applicable cog. You may want to mark it as hidden in your info.json so it does not get listed on the Red Index.

SWGOHTools

  • :memo: The short and description info.json fields should spell out the entire game name instead of assuming the acronym will be commonly known
  • You do not currently restrict the values of numeric inputs. You may want to include checks in the commands that set these values to ensure they are not negative or are below some maximum value, if any restrictions like that apply.

Thank you for making the requested changes. I have reviewed the remaining cogs, and have one more set of required changes. Once these changes are addressed, your repo should be ready to go!


Commit hash: 644cfbe5c3f26c4920c000b077e03067e0fbf984
Red v3.5.24
Consider only bullets prefixed with :memo: to be required.


CivVIRandom

N/A

Dictionary

  • :memo: The bot only responds with Dictionary lookup took too long.. Is the API you are using still valid?

FandomSearch

  • :memo: You should not be storing data relative to where the cog’s code is. This folder is managed by Downloader, and the data you store can be deleted at any time. Instead, store data in the cog_data_path folder.

HOI4Random

  • :memo: This cog only contains slash commands. The install_msg instruction to run [p]help Hoi4Random does not work, as there are no text commands. Your install_msg should instruct users that the cog uses slash commands.
  • :memo: /hoi4random index raises an error as the message is too long:
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\hoi4random\hoi4random.py", line 37, in index
        await interaction.response.send_message(f"```The full HOI 4 Leader list is:\n- {indexseparator.join(COUNTRYLIST.keys())}```")
    discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
    In data.content: Must be 2000 or fewer in length.
    

IdentityTheft

  • :memo: Because you have await ctx.send_help() in the body of your group command (without invoke_without_command=True), help is sent when any subcommand is successfully invoked. This is because the group command is executed first in addition to subcommands in this configuration. You can either remove the body of the group command and replace it with pass (and Red will properly send help if no subcommand is passed) or add invoke_without_command=True (and explicitly define the behavior when just the group command is executed).
  • :memo: Because you have @checks.admin() on the group command, non-admin users cannot use the subcommand [p]identitytheft blacklist to opt-out of the cog, as that command inherits permissions from its parent.
    • The checks module is technically deprecated, and @commands.admin() should be used instead.
  • Consider making the blacklist a user setting, not a list within the guild settings. That way a user only needs to opt out one time, and it is tracked across any number of servers the bot is in.

Languify

  • :memo: The API key configuration should not be configurable by those with the administrator permission when it is applied bot-wide.
  • :memo: You should not be storing data relative to where the cog’s code is. This folder is managed by Downloader, and the data you store can be deleted at any time. Instead, store data in the cog_data_path folder.
    • Ideally, API keys should be stored using Red’s API key framework to ensure a standardized user experience across cogs with additional protection of the keys.
  • :memo: Your failure messages can be fun and on theme, but they should still accurately explain what is wrong and how to fix it. The missing API key message should include instructions (or a reference to instructions) on how to set the key.
  • Defaulting to a random language when one of the languages requires an API key that may not be configured doesn’t seem to make sense.
    • Should the language be an optional parameter of the command instead of a setting?
  • It is weird that the actual commands to execute the cog are text-only, but the configuration commands are app command only

NoLinksInNames

  • It might be worth paginating the output of [p]guildlinkcheck just in case the list exceeds 2000 characters.

SpideyCasino

  • It might be nice to add feedback besides disabling the buttons when the game ends to state the result (perhaps in the embed message somewhere?)

SpideyGames

N/A

StatusSet

N/A

WhoAmI

  • :memo: This cog only contains slash commands. The install_msg instruction to run [p]help WhoAmI does not work, as there are no text commands. Your install_msg should instruct users that the cog uses slash commands.
  • You may want to consider generating the stats by seeding the random number generator with the user’s ID. That will ensure a fixed set of stats for a particular user without requiring initial generation or storing the stats. It will also make the stats the same across different bots.

WorldOfApis

  • :memo: You should not be storing data relative to where the cog’s code is. This folder is managed by Downloader, and the data you store can be deleted at any time. Instead, store data in the cog_data_path folder.
    • Ideally, API keys should be stored using Red’s API key framework to ensure a standardized user experience across cogs with additional protection of the keys.
    • Seina’s cog animals also uses this API under the name thecatapi with the key name api_key, if you also use this formatting the two cogs can share the same key input.
  • :memo: [p]wtrivia raises an error if the bot does not have embed_links permissions:
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\worldofapis\worldofapis.py", line 546, in trivia
        await ctx.send(embed=embed)
    discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
    
  • :memo: /woa insult always seems to raise an error, the API you are using likely changed in some way:
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\worldofapis\worldofapis.py", line 705, in insult
        data = await resp.json()
    aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('...')
    
  • Your cog can supply NSFW jokes, but only within NSFW discord channels. You can check channel.nsfw to determine if a channels is an NSFW channel.