Glas-cogs

Discord Name: Glas

GitHub Repository (Must be V3): GitHub - DJTOMATO/glas-cogs: dumb cogs for Red-DiscordBot

Description: A bunch of silly cogs that nobody would use, mostly memes and one than other useful cog, also some forks with updates and new content!

Been using Red for some years and want to give it back to the community somehow, thanks to everyone’s patience teaching me, I have been able to “create” these.

1 Like

Apologies for the long delay, I have assigned myself to this and looking to complete the review over the comings weeks.

1 Like

Hi, just wondering if there’s any progress with my cog creator application, if you have a draft at least it will be awesome so I can start fixing potential issues within my cogs :heart:

Thank you for your patience. Since you have been waiting for quite some time, and since I am seeing some of the same patterns of issues across your repo, I am providing a checkpoint review after going through about half of your cogs. 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. You may also want to review the approved CC requirements while you apply your changes.

Please let me know when you have applied the requested changes. I may or may not have time to 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: d1efede5d9b345de69866eede602a232afbe0653
Red v3.5.20
Consider only bullets prefixed with :memo: to be required.

The following cogs have not yet been reviewed: Anime, Deals, HoloWiki, MakeSweet, Ogey, PFPImgen, Quoter, Rizz, Sekai, Umineko, Watamelon, WeeedCog, YGOCard

General

  • The repo takes an exceptionally long time to be added, likely due to the amount of bundled data it contains.
  • Your cogs frequently contain unused code. A large number of your cogs perform similar underlying logic, so it appears like left over logic when cloning a cog for a new idea.
  • When creating a docstring for your cog or command, everything before the first empty line is the short description, which appears in the command lists, and everything after the first empty line is part of the full description, which only appears in the [p]help commandname output as non-bold text. See the output of [p]help ban for a good example. Formatting your docstrings with this in mind makes them more readable.

Bubble

  • The cog class name is not intuitive. I would suggest renaming the class to Bubble.
  • :memo: The cog uses the lib pillow, but does not include it in the requirements.
  • The file functions.py is never used.
  • :memo: The cog is missing a docstring, so no help text is provided.
  • The command docstring is split across multiple strings, which results in only the first string actually being applied. It should be formatted as:
    """Make a Speech bubble...
    
    Example: !bubble @User/username
    Use it without mention to grab last image/attachment in a channel."""
    
    • It should probably state that an image can also be attached to the command message or a link.
  • The third check in get_last_image_attachment is a subset of the first check, and should never produce a valid answer.

Doro

  • The cog and command sharing the same casing results in it being impossible to run [p]help on the command. Consider renaming the cog class to Doro.
  • :memo: The cog uses the lib pillow, but does not include it in the requirements.
  • The cog docstring is not meaningful.
  • :memo: This cog does not check if the bot has attach_files permissions prior to attempting to send the image, which will lead to an error.

Fire

  • :memo: yt-dlp==2025.1.15 only supports python 3.9+. A confusing error will be presented if users attempt to install this cog using 3.8. You use the min_python_version info.json key to match this restriction.
    • The cog doesn’t even use this lib, so I don’t know why it is in the requirements…
  • The cog class name is not intuitive. I would suggest renaming the class to Fire.
  • :memo: The cog is missing a docstring, so no help text is provided.
  • :memo: This cog does not check if the bot has embed_links permissions prior to attempting to send an embed, which will lead to an error.

GoogleIt

  • The cog class name is not intuitive. I would suggest renaming the class to either GoogleIt or Googleit.
  • :memo: The cog and some commands are missing docstrings, so no help text is provided.
  • The commands for configuring the endpoint do not have syntax that implies they are from your cog
  • :memo: The commands for configuring the endpoint do so only in memory, which does not persist between loads.
  • The option to use [p]googleit endpoint to see/configure the endpoint is not documented.
  • :memo: [p]googleit endpoint does not have is_owner checks, and can be ran by any user.
  • I have no idea why the command signature has option, value, and args, then just pulls from clean_content.
  • :memo: This cog does not check if the bot has embed_links permissions prior to attempting to send an embed, which will lead to an error.

HowLongToBeat

  • :memo: The latest version of howlongtobeatpy depends on fake-useragent>=2.0.3, which only supports python 3.9+. A confusing error will be presented if users attempt to install this cog using 3.8. You use the min_python_version info.json key to match this restriction.
  • :memo: The cog uses the lib fuzzywuzzy, but does not include it in the requirements.
  • The cog class name and only command name are not intuitive, which makes it hard to figure out how to use this cog. I would suggest renaming the class to HowLongToBeat.
  • :memo: This cog does not check if the bot has embed_links permissions prior to attempting to send an embed, which will lead to an error.
  • Rather than having to strip and join, consider using the signature ctx: commands.Context, *, game_name: str to capture spaces in game_name.
  • Your fuzzywuzzy comparison is currently case sensitive. Consider either .casefolding the strings before passing them, or using the processor kwarg of ratio.

LetterDance

  • :memo: You should include ntoskrn in the authors key of the cog info.json.
  • The cog class name is not intuitive. I would suggest renaming the class to either LetterDance or Letterdance.
  • :memo: This cog does not check if the bot has attach_files permissions prior to attempting to send the gif, which will lead to an error.
  • Consider resetting the cooldown when an invalid input is passed using reset_cooldown.
  • I’m not sure why imageio is used instead of Pillow’s image logic, but it seems to never close the file for the letter gifs when it reads from them.

MovieTar

  • :memo: The latest version of moviepy depends on numpy>=1.25.0, which only supports python 3.9+. A confusing error will be presented if users attempt to install this cog using 3.8. You use the min_python_version info.json key to match this restriction.
  • :memo: At some point (v2.0.0?), all was removed as a valid import from moviepy.video.fx. I can’t find when, but the lack of a fixed version in your requirements means this cog will not work for new users.
    • Attempting to downgrade to v1.0.3 manually, I still can’t get the cog to actually function, with error AttributeError: 'ImageClip' object has no attribute 'with_duration'
  • You create both a cog-scoped and file-scopped logger, then use neither of them.
  • @app_commands.guild_only() on a hybrid command does not apply to the text version of that command. Use the version from the commands package instead.
    • The makevideo command does not have a docstring for its text command version.
    • If you want a slash only command, but do not want to break your logic due to the interaction, consider using Context.from_interaction.

PokeFuse

  • The cog class name is not intuitive. I would suggest renaming the class to either PokeFuse or Pokefuse.
  • :memo: Your data files should be located in the subfolder /data and accessed via the bundled_data_path method.
  • :memo: The names and ids lists grow in size every time the command is used, which is a (very minor) memory leak.
    • Either load them once on cog load and store them in memory then, or just read the file each time the command is used without trying to persistently store.
  • Your __init__ method in pokefusion.py isn’t in the class, so it is never called.
    • If it were called, it would not work, as datacheck is not awaited.
  • There is no reason for any of the functions in functions.py to be async, as they never do any asynchronous work.
  • :memo: This cog does not check if the bot has embed_links permissions prior to attempting to send an embed, which will lead to an error.

RedBus

  • The cog class name and only command name are not intuitive, which makes it hard to figure out how to use this cog. I would suggest renaming the class to either RedBus or Redbus.
  • :memo: The install_msg contains a hardcoded ! prefix.
  • :memo: The cog and command are missing docstrings, so no help text is provided.
    • It is completely unclear from the lack of help text and the error message what a “valid bus stop ID” would be, or what the number maps to.
  • :memo: The API seems to respond to all of the possible input stop IDs with 400 “Malformed Stop ID parameter”.
    • I can’t find the API docs to debug what it should be.
  • :memo: The default locale for cogs must be English, with alternate languages provided using the i18n framework.
  • :memo: This cog does not check if the bot has embed_links permissions prior to attempting to send an embed, which will lead to an error.

Shibe
N/A

Ship

  • :memo: The cog is missing a docstring, so no help text is provided.
  • The cog should use the i18n framework to provide translations, rather than lots of if statements.
  • The file functions.py is never used.
  • The hardcoded custom emoji will not be available to most bots.

Valentine

  • :memo: The cog is missing a docstring, so no help text is provided.
  • The cog should use the i18n framework to provide translations, rather than lots of if statements.

VWiki

  • :memo: The cog contains unidecode in the requirements, but does not use this library.
  • :memo: The cog uses the lib vtuberwiki-py, but does not include it in the requirements.
  • :memo: The command is missing a docstring, so no help text is provided.
  • :memo: I can’t get the command to do anything other than error, potentially due to a library bug:
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\vwiki\vwiki.py", line 33, in vsearch
        sm, tr, qt, nm, img = await self.search(chuuba)
      File "datapath\cogs\CogManager\cogs\vwiki\vwiki.py", line 22, in search
        sm = await vwiki.summary(vtuber=f"{chuuba}")
      File "datapath\cogs\Downloader\lib\vtuberwiki\aiovwiki.py", line 118, in summary
        img = body.find("img",class_="pi-image-thumbnail")
    AttributeError: 'NoneType' object has no attribute 'find'
    
  • :memo: This cog does not check if the bot has embed_links permissions prior to attempting to send an embed, which will lead to an error.

YouWouldnt

  • :memo: The cog contains unidecode in the requirements, but does not use this library.