Wyn Cogs

#1

Discord Name:
Wyn#0004

GitHub Repository (Must be V3):

Description:
Fun/utility cogs I’ve ported or made for V3.

assigned Flame442 #3
#4

Commit hash: 8a2dadb082213ee8c794c93638cf6e35fbb5ab41
Red v3.1.2
Consider anything prefaced with “You might want” to be optional

General
-You need a repo-level info.json.

Anisearch
-You might want to make embeds have the color selected by the user with await ctx.embed_color().
-Every single menu in a guild by a specific user is affected by every other menu’s controls from that user because you only check if ctx.author is the same.
-Is there any reason why you aren’t using Red’s menu util?
-You must have a print still somewhere because my console is spammed with json gibberish.
-Nothing in your info.json works because your keys are all uppercase. They need to be lowercase.
-The author field of your info.json needs to be a list of strings, as in ["Jintaku", "Wyn"].
-Every command throws an error when the bot does not have permission to send embeds:

"<datapath>\cogs\CogManager\cogs\anisearch\anisearch.py", line 369, in anime
    await anilist_menu(ctx, embeds, message=None, page=0, timeout=30)
  File "<datapath>\cogs\CogManager\cogs\anisearch\anisearch.py", line 430, in anilist_menu
    message = await ctx.send(embed=emb)
discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions

Lyrics
-You might want to make embeds have the color selected by the user with await ctx.embed_color().
-The author field of your info.json needs to be a list of strings, as in ["Wyn"].
-The pass you have on L24 does absolutely nothing, the group command’s docstring is technically enough to not throw an indentation error, even though it is better to have an explicit pass. Unindent the pass to be under the group command’s function.
-You are using requests, which is blocking. Use aiohttp or another non-blocking lib.
-Why are you sending discord.HTTPException errors in L42-43/73-74?
-Every command throws an error when the bot does not have permission to send embeds:

"<datapath>\cogs\CogManager\cogs\lyrics\lyrics.py", line 40, in search
    await ctx.send(embed=e)
discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions

Sysinfo
-Nothing in your info.json works because your keys are all uppercase. They need to be lowercase.
-The author field of your info.json needs to be a list of strings, as in ["kagami#6142", "Wyn"].
-Although the package should be properly installed once your info.json is sorted out, you should have users use the [p]pipinstall command to manually install packages so they are properly installed if the user is running the bot in a venv.
-The help text of [p]sysinfo info is cut off.
-You might want to use pagify for your outputs instead of your own version that does the same thing.
-The group command [p]sysinfo has no checks, so non-owners will see it as having no subcommands (but still visible).
-You might want to put the checks.is_owner only on the group command instead of on every subcommand.
-[p]sysinfo info takes in args... but only returns all parts (if no args are provided) or the first arg (if one or more are provided).
—If you only want to accept one arg, replace the *args: str with args: str=None and check if it is None.
—If you want more than one arg to be accepted, replace the args[0].lower() == 'cpu' with if 'cpu' in args (after looping through the args to .lower() them all).
-[p]sysinfo smem throws an error for me:

"<datapath>\cogs\CogManager\cogs\sysinfo\sysinfo.py", line 463, in smem
    p._info["username"][:7],
TypeError: 'NoneType' object is not subscriptable
#5

Thanks for the read up, I’ll get on it asap when home from work.

Regarding [p]sysinfo smem not working entirely it’s working fine over here on the Red dev branch so I’d need to know the distro.

#6

Red v3.1.2
Py v3.7.1
Windows 10 version 1803 Build 17134.829

If you need anything else, let me know.

#7

Quickly fixed up lyrics before heading to bed.

The command that error’d for you worked on a Windows 2012 server, guessing it’s some weird Win10 bug and I’ll add a catch for it when I wake up.

#8

Hi Wyn. Some issues with Lyrics are still present after your changes, and some new issues popped up. Keep in mind that the requested changes for all other cogs are still in effect, this list only applies to the lyrics cog.

Commit hash: e497a886d941d4416efe7dca23a5becb38b2217c
Red v3.1.2

-The pass on L24 was not addressed.
-The “Missing embed permissions…” warnings on L43 and L77 throw an error because colour is not a keyword of ctx.send():

"<datapath>\cogs\CogManager\cogs\lyrics\lyrics.py", line 43, in search
    return await ctx.send("Missing embed permissions..", colour=await ctx.embed_color())
TypeError: send() got an unexpected keyword argument 'colour'

-The “Nothing Playing.” and “Audio Not Loaded.” embeds (L60/63/66) do not have a catch for the bot not having embed perms:

"<datapath>\cogs\CogManager\cogs\lyrics\lyrics.py", line 64, in playing
    embed=discord.Embed(description="Nothing playing.", colour=await ctx.embed_color()))
discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions
#9

Ugh I must’ve reverted changes by mistake when makin sure the search was working. Thanks I’ll get right on it.