Snake-Cogs

#1

Discord Name: WaterSnake#0563

GitHub Repository (Must be V3): https://github.com/samclane/Snake-Cogs/tree/v3

Description: Snake-Cogs contains several utility Cogs that I use on my personal server.

  • OnJoin: Ventrillo-Style TTS announcer when users join Voice Channels

  • NetworkTool: Opens a Websocket that allows some of the bot info to be viewed from a web browser (data/gui.html)

  • DamnDog: A Discord port of the damn.dog WikiHow guessing-game

assigned TrustyJAID #2
#3

Hi samclane, thank you for your patience while I review your repo.

Commit hash at time of review - 0ee19d68c38ac9be12a732ca03ab6340a03626bc

DamnDog

DamndDog.py

  • Line 33 and Line 180: The way you format your data paths here break anyone using a linux machine. I would use str(data_manager.bundled_data_path(self) / "img") so that python builds the proper string for the path for you rather than forcing this to be windows only.
  • Line 147 and 153: as of Red version 3.1 all listeners are required to have a decorator @commands.Cog.listener() in order to function with d.py. There are ways to keep backwards compatibility support with 3.0.0 as your info.json suggests for the minimum bot version if you need to keep that it would look something like
listener = getattr(commands.Cog, "listener", None)

if listener is None:  # thanks Sinbad
   def listener(name=None):
       return lambda x: x


class DamnDog(commands.Cog):
   ...
   @listener()
   async def on_message(self, message):
   	...

NetworkTool

NetworkTool.py

  • Line 11: RedBase is not the bot object you want to typehint just use Red

OnJoin

This is a really neat cog that I see no major issues with. Some things to note though is there are cogs already approved using the [p]say command to simply have the bot say a message in a specific channel which is fairly simple people wouldn’t be able to use both this cog and those other ones at the same time. It would be nice to be able to customize the message when a user joins a voice channel as well as be able to toggle it on and off. Logging every time the cog tries to play a message in voice is a little spammy it might be better to set that to debug. I’m sure these changes would make this cog highly popular for a lot of people. These changes are entirely optional just some things to consider.