Sea-cogs

Discord Name: seasw.

GitHub Repository (Must be V3): cswimr/SeaCogs: My assorted cogs for Red-DiscordBot. - CoastalCommits

Description: Here’s a list of the cogs in this repository at the time of this post and what they do:

Antipolls

This cog automatically deletes messages that contain polls, with a configurable per-guild role and channel whitelist and support for default Discord permissions (Manage Messages).
This was created back when polls were originally released, and before the Create Polls permission was added. It’s currently hidden on the repository, as it’s kind of useless now.

Aurora

Replacement for Red’s core mod cogs - will eventually be able to import/export to/from Red’s core mod cogs, but for the time being cannot do so.
This cog is very much a work in progress, bear that in mind when reviewing - also, there’s a far more up-to-date version of Aurora on the aurora-pydantic branch, that hasn’t been merged yet.
The updated version of Aurora will be able to have other cogs hook into it to provide custom functionality, through the use of a moderation type registry.

Backup

Reimplements a lot of Downloader functionality in order to allow people to retrieve a list of repositories and cogs they have installed on their bot, and use that list to re-add repositories and reinstall cogs on another instance.

Bible

Uses the API.Bible service to retrieve Bible passages.

EmojiInfo

Allows users to retrieve information about both built-in discord emojis, and custom (guild) emojis.

Nerdify

Joke cog that wraps input text in "input" 🤓.

Pterodactyl

Uses the Pterodactyl API to manage game servers. Made primarily for Minecraft, but should technically work with any Pterodactyl egg. Features bidirectional chat forwarding, reporting when the server starts or stops, forwarding console logs to discord, running commands on the server, managing the server’s power actions, and more!

SeaUtils

Just a small utility cog that contains a few commands I use on my own bots.

Thank you for your patience.

Commit hash: 4cc0ed5a7d8580290ebdd12af0d9b525297bc3e3
Red v3.5.22
Consider only bullets prefixed with :memo: to be required.

General

  • :memo: The cog_command_error function in your custom cog subclass logic is catching BotMissingPermissions check errors and presenting them as unhandled exceptions instead of passing them to the core error handler:
    [2026-01-03 18:30:22] [ERROR] red.SeaCogs.TickChanger: Uncaught exception in command 'tickchanger view'! Exception ID: 'kkeumt7zzs'
    Traceback (most recent call last):
      ...
      File "site-packages\redbot\core\commands\requires.py", line 517, in _verify_bot
        raise BotMissingPermissions(missing=self._missing_perms(self.bot_perms, bot_perms))
    redbot.core.commands.errors.BotMissingPermissions
    
    • I would worry that other exceptions that are part of normal control flow may be caught by this handler prior to reaching their intended destination.
  • The install_msg for Bible and HotReload, as well as the [p]help CogName documentation link for each cog leads to a 404 page.

Aurora (Hidden)
N/A

Backup

  • If all of the subcommands are going to be owner locked, it doesn’t make sense for the group command to appear in help for non-owner users.
  • :memo: [p]backup export and [p]backup import have an unhandled exception if used in a channel where the bot does not have attach_files permissions:
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\backup\backup.py", line 70, in backup_export
        await ctx.send(file=cf.text_to_file(json.dumps(export_data, indent=4), "backup.json"))
    discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
    

Bible

  • :memo: Commands return an unhandled error when an API key is missing. Consider giving instructions for configuring the cog instead.
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\bible\bible.py", line 120, in bible_random
        bible = await self.fetch_bible_for_context(ctx)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "datapath\cogs\CogManager\cogs\bible\bible.py", line 89, in fetch_bible_for_context
        return await BibleModel.fetch(self, bible_id, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "datapath\cogs\CogManager\cogs\bible\models\bible.py", line 103, in fetch
        raise BibleAccessError
    bible.errors.BibleAccessError: No message was provided for this exception!
    
  • :memo: self.session is defined for your cog (subclass) on cog_load. The overridden tidegear_session_headers injecting the API key is called at this time. If the bot owner changes the key (including setting it for the first time), the session object is not updated. The cog must be reloaded to apply the API key changes.

EmojiInfo

  • Multi-part emojis such as flags appear to render an image and link only for the first component. :flag_az: has an image/url for :regional_indicator_a:.

HotReload

  • If all of the subcommands are going to be owner locked, it doesn’t make sense for the group command to appear in help for non-owner users.
  • Changing cog install paths will not cause them to be observed by this cog unless this cog is reloaded. The only way to fix this would be some kind of on_command internals watching jank, but it might make sense to mention it somewhere.
  • It does not make sense to require an info.json file to be present, since only cogs installed via downloader are able to use that file (to my knowledge).

IssueCards

  • :memo: Some kind of dependency version issue is happening with this cog that prevents me from configuring it:
    [WARNING] py.warnings: datapath\cogs\CogManager\cogs\issuecards\models\provider.py:245: PydanticDeprecatedSince20: The `json` method is deprecated; use `model_dump_json` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.11/migration/
      new_provider = self.json(remove_token=False)
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\issuecards\issuecards.py", line 270, in issuecards_providers_add
        await provider.to_config()
      File "datapath\cogs\CogManager\cogs\issuecards\models\provider.py", line 245, in to_config
        new_provider = self.json(remove_token=False)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "site-packages\pydantic\main.py", line 1317, in json
        raise TypeError('`dumps_kwargs` keyword arguments are no longer supported.')
    TypeError: `dumps_kwargs` keyword arguments are no longer supported.
    
  • :memo: It does not appear that the on_message_without_command listener checks for embed_link permissions in the channel prior to attempting to send, but I cannot confirm this is an issue without the cog working.

Nerdify
N/A

Pterodactyl

  • :memo: This cog seems to be designed for specifically interacting with some kind of minecraft server, but this is not clear from the cog name or descriptions. It is also not explained how to set up a server to be compatible with this cog, or how to configure the cog to see that server. The dead documentation links are likely contributing to this, but ideally it would be more clear in the cog description so users know if this is a cog they want to install from just the index page.
  • :memo: Loading the cog for the first time with nothing configured leads to the following error repeatedly posted in console (with exponential backoff):
    Traceback (most recent call last):
      File "datapath\cogs\CogManager\cogs\pterodactyl\pterodactyl.py", line 95, in update_topic
        topic = await self.get_topic()
                ^^^^^^^^^^^^^^^^^^^^^^
      File "datapath\cogs\CogManager\cogs\pterodactyl\pterodactyl.py", line 152, in get_topic
        status = await pymcsrvstatus.fetch(await config.topic_hostname(), await config.topic_port())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "datapath\cogs\Downloader\lib\pymcsrvstatus\api.py", line 26, in fetch
        return ServerStatus(**await response.json())
                              ^^^^^^^^^^^^^^^^^^^^^
    aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://api.mcsrvstat.us/')
    
    • :memo: Similarly, most commands produce some kind of unhandled error when unconfigured.
  • You should probably check/catch edit permissions errors in your update_topic loop in addition to confirming the channel still exists.
  • The slash power and command commands do not have the admin check that the text command versions have.
    • The admin decorator is being added to core in #6400. Until then you would need to manually re-implement the check or use a similar check that is provided by discord.py.
  • I understand not making the power and command commands owner-only to allow them to be configured using permissions, but I also think that them being usable by admins by default is not intuitive like other default command permissions generally are. There is nothing in Red that explicitly states the default checks for a command (and it would be impossible to program something that could tell what an arbitrary check function does), so this is a case where I think it is best if you explain the defaults somewhere.
    • This could be another issue with the documentation being a dead link, but it may also make sense to put it in the docstring of these commands or in the install_msg.
    • Slash command permissions applied in the UI do not work like the permissions cog, meaning a server owner can always override the configured permissions (unless those checks are done invoke-side). The same line of logic for making the commands not owner-only to allow them to be modified does not work as well for the slash versions.

SeaUtils (Hidden)
N/A

TickChanger

  • :memo: The group command [p]tickchanger is missing help text.
  • The subcommand docstrings should probably be written more for users. The function names matter less than the kind of ticks, and it isn’t clear what a Tidegear cog is.
  • If all of the subcommands are going to be owner locked, it doesn’t make sense for the group command to appear in help for non-owner users.
  • If the converter fails, it falls back to resetting the tick instead of alerting the user. If I recall correctly this is some interaction with unions. I’m not going to investigate further, but it might be nicer to give feedback.

It’s taken me longer to get this all sorted than I expected, so I figured mentioning that I had seen this and am working on it would be good. Thanks again for the review! Will hopefully be ready for re-review in a couple days.