1 Configuring
Qemlokriu edited this page 2 years ago

Configuring Mee2

Step 1: Locate the configuration file

The configuration file for the Mee2 bot is called config.toml and is located in the root directory of the bot (where main.py is).

Step 2: Understand the structure of the configuration file

The configuration file is written in TOML format and is divided into sections. Each section contains a list of key-value pairs that define the settings for the bot. The default config.toml file contains one section:

Bot section

The [bot] section defines general settings for the bot, such as which cogs to load and which Discord servers (guilds) to register the commands in. Here is an example [bot] section:

  • Cogs. This variable is a table of strings wich contain paths to cogs/extensions for mee2. To make a cog be registered by mee2 you have to add it to this list. Here is a example cogs table: cogs = ["cogs.essentials.commands", "cogs.example"] Notice that Essentials has a .commands wich is the actual .py file and "essentials" is the folder that it is in. For this reason it is a good practice to see the readme of the cog you are downloading.
  • guild_ids. This is another table. Here you will have to list the ID's of the guilds/servers that you want the commands to be registered in. This variable is shared across all the cogs so you don't have to change it in each cog. To get a guild id activate developer mode in discord Once you have done that, right click on a server and click Copy ID. Now put that new id as follows: guild_ids = ["1234567891011", "Yournewguildid"]

Example config file:

[bot]
cogs = ["cogs.essentials.commands"]
guild_ids = ["123456789123456789"]
log_lever = "INFO"

In this example, the cogs key specifies the path to Essentials, and the guild_ids key specifies the Discord server IDs.