[APPROVED] Flare-Cogs

Discord Name: flare#0001

GitHub Repository (Must be V3): https://github.com/flaree/Flare-Cogs

Description: A few cogs I rewrote that I needed for a gameserver.

Forward - Forward all messages/attachments to the owner of the bot.
ModMail - Configurable modmail to forward messages to a certain channel.
Highlight - Highlight chosen words to be notified upon in a certain channel.
SAMP - San Andreas Multiplayer server lookup.

Hello Flare, I will be taking a look at your repo sometime soon and I’ll add my comments here when I have that ready for you.

1 Like

Thank you for your patience while I found the time to take a look at this.

Forward - I appreciate you porting this to v3 as I didn’t have time. The only thing I noticed that could be improved about this cog is that when a bot sends an embed message to a user (like the help messages) the report/forwarded message in DMs is blank and doesn’t include the embed content. This point/item also will not disqualify you from anything in this review, it’s only something I noticed while checking it (because my version of forwarding has the same issue, heh).

Highlight - I’ve been using this in some pretty heavy rotation on some of my bots and you have been very responsive when I have submitted PRs or ideas for this cog. Thanks for that.

Modmail - looks good. Couldn’t find anything to comment on here. Works as intended.

samp - When you try to query a server/ip that isn’t on the website, there is an error:

[14/05/2019 08:17] ERROR events on_command_error 202: Exception in command 'samp'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped
    ret = await coro(*args, **kwargs)
  File "/Users/user/Red/cogs/CogManager/cogs/samp/samp.py", line 34, in samp
    r = await self.get(req)
  File "/Users/user/Red/cogs/CogManager/cogs/samp/samp.py", line 20, in get
    return await response.json()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 1027, in json
    headers=self.headers)
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8'

Other than that little point on samp everything looks great.

1 Like

Hey,
Thanks for the review!

I’ve went ahead and pushed a fix for the samp issue and will definitely look into the embed content as soon as my exams finish.

edit: Also have published a 3.0.2 branch for pre-3.1 changes,

Hi Flare, I’m getting

/usr/local/lib/python3.7/site-packages/discord/ext/commands/cog.py:411: RuntimeWarning: coroutine 'Samp.cog_unload' was never awaited

while unloading your samp cog. I’d suggest using something like
await self.bot.loop.create_task(self._session.close())
instead of
asyncio.get_event_loop().create_task(self._session.close()).

Once this is taken care of I think you’re all set to go.

1 Like

A fix has been pushed for this, thank you!

Thanks flare. I’m marking this as approved and will be assigning the role in a bit.

1 Like