This page is generated from
docs/guide_publish_cogs.rst- please edit the source file instead of this page.
Publishing cogs for Red
Users of Red install 3rd-party cogs using Downloader cog. To make your cog available to install for others, you will have to create a git repository and publish it on git repository hosting (for example GitHub)
Repository Template
We have standardized what a repository's structure should look like to better assist our Downloader system and provide essential information to the Red portal.
The main repository should contain at a minimum:
- An info.json file
- One folder for each cog package in the repository
- refer to Creating cogs for Red for information on how to create a valid cog package
- you should also put info.json file inside each cog folder
We also recommend adding a license and README file with general information about the repository.
For a simple example of what this might look like when finished, take a look at our example template.
Info.json format
The optional info.json file may exist inside every package folder in the repo, as well as in the root of the repo. The following sections describe the valid keys within an info file (and maybe how the Downloader cog uses them).
Keys common to both repo and cog info.json (case sensitive)
-
author(list of strings) - list of names of authors of the cog or repo. -
description(string) - A long description of the cog or repo. For cogs, this is displayed when a user executes[p]cog info. -
install_msg(string) - The message that gets displayed when a cog is installed or a repo is addedTIP
You can use the
[p]key in your string to use the prefix used for installing, and[botname]to show the bot's username. -
short(string) - A short description of the cog or repo. For cogs, this info is displayed when a user executes[p]cog list
Keys specific to the cog info.json (case sensitive)
-
end_user_data_statement(string) - A statement explaining what end user data the cog is storing. This is displayed when a user executes[p]cog info. If the statement has changed since last update, user will be informed during the update. -
min_bot_version(string) - Min version number of Red in the formatMAJOR.MINOR.MICRO -
max_bot_version(string) - Max version number of Red in the formatMAJOR.MINOR.MICRO, ifmin_bot_versionis newer thanmax_bot_version,max_bot_versionwill be ignored -
min_python_version(list of integers) - Min version number of Python in the format[MAJOR, MINOR, PATCH] -
max_python_version(list of integers) - Max version number of Python in the format[MAJOR, MINOR]or[MAJOR, MINOR, PATCH]. Only the given parts are compared, e.g.[3, 12]allows all Python 3.12.x versions but not 3.13. If not set, there is no upper limit. -
hidden(bool) - Determines if a cog is visible in the cog list for a repo. -
disabled(bool) - Determines if a cog is available for install. -
required_cogs(dict mapping a cog name to repo URL) - A dict of required cogs that this cog depends on in the format{cog_name : repo_url}. Downloader will not deal with this functionality but it may be useful for other cogs. -
requirements(list of strings) - list of required libraries that are passed to pip on cog install. -
optional_privileged_intents(dict mapping a privileged intent name to reason it's needed) - A dict of privileged intents that this cog needs for some of its functionality. When the bot doesn't have any of the optional privileged intents, the cog should still function to some degree, handling the lacking intents gracefully. Downloader will let the user install a cog, when an optional privileged intent is missing.
The key is one of the following privileged intent names:message_content,members,presences.
The value should be a statement explaining the reason the intent specified in the key is needed.
Privileged intents present in this dict cannot be present in therequired_privileged_intentsdict.
Theoptional_privileged_intentskey can only be specified, whenrequired_privileged_intentsdict is present. -
required_privileged_intents(dict mapping a privileged intent name to reason it's needed) - A dict of privileged intents that this cog requires to function. When the bot doesn't have any of the required privileged intents, it may not work correctly (or outright refuse to load) and Downloader will not allow the user to install it. The key is one of the following privileged intent names:message_content,members,presences.
The value should be a statement explaining the reason the intent specified in the key is needed.
Privileged intents present in this dict cannot be present in theoptional_privileged_intentsdict.
When this is{}, the cog can function without any privileged intents.
When this is not present (orNone), cog is assumed to requiremessage_contentandmembersintents with an unknown reason. Downloader will, however, allow the cog to be installed despite that since a dict has not been explicitly specified.NOTE
Since the user may change intents configuration after cog is installed, the cog may be loaded even when some of the required privileged intents are not available. If the intent is truly required for the cog to function, it's recommended to check intents at load and raise
CogLoadError, if any intents you need are missing. -
tags(list of strings) - A list of strings that are related to the functionality of the cog. Used to aid in searching. -
type(string) - Optional, defaults toCOG. There are currently no other types.
Adding to the Index
Repositories that are correctly configured can be added to the public index of cogs.
To be added to the index, make a pull request to the Red-Index repository in the unapproved section. You can learn more about this process in the repository description.
To be added to the approved repositories, first see Becoming an Approved Cog Creator.
Installation Guides
- Installing Red
- Creating a bot account
- Updating Red
- Backing Up and Restoring Red
- About Virtual Environments
- Setting up auto-restart using batch on Windows
- Setting up auto-restart on Mac
- Setting up auto-restart using systemd on Linux
Cog Reference
User guides
- Getting started
- Running Red on Fluxer
- About Privileged Intents
- About public (big) bots
- Admin
- Alias
- Audio
- Cleanup
- Cog Manager UI
- Core
- CustomCommands
- Dev
- Downloader
- Economy
- Filter
- General
- Image
- Permissions
- Mod
- ModLog
- Mutes
- Reports
- Streams
- Trivia
- Warnings
- Red and End User Data
Cog Creation Guides
- Creating cogs for Red
- Slash Commands and Interactions
- Publishing cogs for Red
- Becoming an Approved Cog Creator
- Versioning
- End-user Guarantees
- Developer Guarantees
- Breaking Change Notices
Cog Development Framework Reference
- Shared API Keys
- Bank
- Bot
- Command Check Decorators
- App Command Check Decorators
- Commands Package
- App Commands Package
- Config
- Data Manager
- Custom Events
- Internationalization Framework
- Mod log
- RPC
- Tree
- Utility Functions
Others
Legacy (Red V2)