[APPROVED] Dav-Cogs

Discord Name: Dav#6998

GitHub Repository (Must be V3): https://github.com/Dav-Git/Dav-Cogs

Description: Convenience cog that made discord stuff easier for me and may benefit others as well. With this Application I just hope to be able to share what I’m doing and possibly help someone else out along the way. I think my readme.md explains the cogs pretty well so I won’t double this here. This repo is a learning project for me and any feedback is greatly appreciated.

Hi Dav, thank you for your patience while I review your repo. I have a few minor things to be addressed and one major thing that needs to be changed before I can approve your repo.

Commit hash at time of review - 7e7242ac34dacf01388b416b5baaf0e117c983f0

bday

bday.py

  • Line 2: tasks is imported but never used. (Optional)

exclusiveroles

exclusiveroles.py

  • Line 14: You should state your repo in the logger alongside the cog name. red.dav-cogs.event_check. This is optional but will help if anyone else ever makes another cog with the same name to differentiate in the logs. (Optional)
  • Line 116-119: This can fail in several ways if any set exclusive roles have been deleted.

mcwhitelister

mcwhitelister.py

  • Line 46-52: You should not be using requests in any cog, look at aiohttp for anything accessing external API’s. Requests is considered blocking so the bot will stop everything it’s doing across all servers to wait for the response from mojang.com to finish which can take a long time causing everything from minor disruptance to outright crashing. It’s as simple as
async with aiohttp.ClientSession() as session:
   async with session.get("https://api.mojang.com/users/profiles/minecraft/{}".format(name)) as resp:
       playerinfo = await resp.json()

Thank you for your review. I’ll look at these changes this evening :slight_smile:

I addressed your review and did some additional changes suggested by Jack. Should be good to go :slight_smile:

Looks good to me, marking this as approved.