From 29e46df0376a4329933ca35968369ec1affae449 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 00:51:17 +0100 Subject: [PATCH 01/51] add guide to install a specific dependency group with poetry This sets up the stage to install the needed bootstrapping script dependencies --- .../installing-project-dependencies.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md index 26d6de300..862f0add1 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md @@ -39,3 +39,27 @@ $ poetry run task precommit ![PyCharm Poetry Environment](/static/images/content/contributing/pycharm_poetry.png)
6. PyCharm will automatically install the packages required into a virtual environment.
![PyCharm Project Interpreter](/static/images/content/contributing/pycharm_poetry_success.png) + + +## Installing specific dependency groups + +In some cases, like when you'll be using the configuration bootstrapping script, you might need to install extra dependencies that are +not necessary for the bot project to function. +These dependency are put in a separate optional group likewise: + +```text +[tool.poetry.group.group-name] +... +[tool.poetry.group.group-name.dependencies] +pytest = "^6.0.0" +pytest-mock = "*" +``` + +To install them, you simply need to run the following command +--- + +```shell +$ poetry install --only {{group-name}} +``` + +--- \ No newline at end of file From 35227dbebf1c71c6a75036a0535839698ccd648d Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 00:56:06 +0100 Subject: [PATCH 02/51] add the Scaffolding the configuration section --- .../guides/pydis-guides/contributing/bot.md | 68 +++++++++++++++---- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 02316bcaf..0b82265be 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -16,8 +16,7 @@ The Python bot is tightly coupled with the Python Discord server, so to have a f It's possible to set the bot to use a single channel for all cogs, but that will cause extreme spam and will be difficult to work with. You can start your own server and set up channels as you see fit, but for your convenience we have a template for a development server you can use: [https://discord.new/zmHtscpYN9E3](https://discord.new/zmHtscpYN9E3). -Keep in mind that this is not a mirror of the Python server, but a reduced version for testing purposes. A lot of the channels in the Python server were merged. - +Keep in mind that this is not an exact mirror of the Python server, but a reduced version for testing purposes. --- ### Set Up a Bot Account @@ -38,7 +37,47 @@ If your bot fails to start with a `PrivilegedIntentsRequired` exception, this in ### Configure the Bot You now have both the bot's code and a server to run it on. It's time you to connect the two by changing the bot's configurations. -#### config.yml +#### Scaffolding the configuration +To make setup much easier, there is a file called `bootstrap_config.py` that represents a script to bootstrap the configuration for you and help you get started immediately +without having to spend much time copying ids from your newly created server into your configuration file. + +**Note** + +This phase can be skipped and done manually, but would require extra manual work. + +##### 1. Script setup +##### 1.1. Environment variables +You will need to create a file called `.env` which will contain two required values for the script to work: `BOT_TOKEN` and `GUILD_ID` +Inside, add the following two lines: + +```text +BOT_TOKEN=YourDiscordBotTokenHere +GUILD_ID=YourDiscordTestServerIdHere +``` +See [here](../creating-bot-account) for help with obtaining the bot token and [here](obtaining-discord-ids.md#guild-id) for help with obtaining the guild's id + +**Note** + +The `.env` file will be ignored by commits. +##### 1.2 Setting up the script environment +The bootstrapping script is Python code like any other. To run it locally, you will need the right version of Python with the necessary packages installed: +1. Make sure you follow steps `1` and `2` [here](#setting-up-a-development-environment) +2. [Install the `config-bootstrap` dependency group](installing-project-dependencies.md#installing-specific-dependency-groups). + +#### 2. Running the script + +Once the script setup phase is complete, all that is left is to run it. +To do this, you'll simply need to run the `configure` poetry task like thise + +```shell +$ poetry run task configure +``` + +Once the script has finished running, you'll notice the creation of a new file called [`.env.server`](#envserver) at your project's root directory. +This file will contain the extracted ids from your newly created server which are necessary for your bot to run. +Congratulations, you have finished the configuration & can now start [running your bot](#run-it-) + +#### .env.server Entering the directory of the cloned code, you will find a file named `config-default.yml`. This file contains the various configurations we use to make the bot run on the Python Discord server, such as channel and role IDs, and the emojis it works with. It also contains configurations such as how long it takes for a help channel to time out, and how many messages a user needs to voice-verify. @@ -629,18 +668,19 @@ If you find any bugs in the bot or would like to request a feature, feel free to ### Appendix: Full ENV File Options The following is a list of all available environment variables used by the bot: -| Variable | Required | Description | -| -------- | -------- | -------- | -| `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | -| `BOT_API_KEY` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | -| `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | +| Variable | Required | Description | +|----------------------| -------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | +| `GUILD_ID` | Always | Your Discord test server's id (see [Set Up a Bot Account](#set-up-a-bot-account)). | +| `BOT_API_KEY` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | +| `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | | `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | -| `BOT_DEBUG` | In production | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default. -| `REDIS_PASSWORD` | When not using FakeRedis | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)). | -| `USE_METRICITY` | When using Metricity | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default. | -| `GITHUB_API_KEY` | When you wish to interact with GitHub | The API key to interact with GitHub, for example to download files for the branding manager. -| `METABASE_USERNAME` | When you wish to interact with Metabase | The username for a Metabase admin account. -| `METABASE_PASSWORD` | When you wish to interact with Metabase | The password for a Metabase admin account. +| `BOT_DEBUG` | In production | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default. +| `REDIS_PASSWORD` | When not using FakeRedis | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)). | +| `USE_METRICITY` | When using Metricity | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default. | +| `GITHUB_API_KEY` | When you wish to interact with GitHub | The API key to interact with GitHub, for example to download files for the branding manager. +| `METABASE_USERNAME` | When you wish to interact with Metabase | The username for a Metabase admin account. +| `METABASE_PASSWORD` | When you wish to interact with Metabase | The password for a Metabase admin account. --- From a0191ddf19e2d6f54fe00ef389d6e83be46b3c8c Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 01:08:16 +0100 Subject: [PATCH 03/51] fix typo in "Installing specific dependency groups" section --- .../contributing/installing-project-dependencies.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md index 862f0add1..9ad240344 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md @@ -43,9 +43,9 @@ $ poetry run task precommit ## Installing specific dependency groups -In some cases, like when you'll be using the configuration bootstrapping script, you might need to install extra dependencies that are +In some cases, like when you'll be using the configuration bootstrapping script, you might need to install extra dependencies that are not necessary for the bot project to function. -These dependency are put in a separate optional group likewise: +These dependencies are generally put in a separate optional group likewise: ```text [tool.poetry.group.group-name] @@ -62,4 +62,4 @@ To install them, you simply need to run the following command $ poetry install --only {{group-name}} ``` ---- \ No newline at end of file +--- From a847bd445a74c6f0386df025d1e83d803b95a561 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 01:09:47 +0100 Subject: [PATCH 04/51] appease linter --- .../guides/pydis-guides/contributing/bot.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 0b82265be..6abc34d80 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -43,7 +43,7 @@ without having to spend much time copying ids from your newly created server int **Note** -This phase can be skipped and done manually, but would require extra manual work. +This phase can be skipped and done manually, but would require extra manual work. ##### 1. Script setup ##### 1.1. Environment variables @@ -668,19 +668,19 @@ If you find any bugs in the bot or would like to request a feature, feel free to ### Appendix: Full ENV File Options The following is a list of all available environment variables used by the bot: -| Variable | Required | Description | -|----------------------| -------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | -| `GUILD_ID` | Always | Your Discord test server's id (see [Set Up a Bot Account](#set-up-a-bot-account)). | -| `BOT_API_KEY` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | -| `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | +| Variable | Required | Description | +|----------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | +| `GUILD_ID` | Always | Your Discord test server's id (see [Set Up a Bot Account](#set-up-a-bot-account)). | +| `BOT_API_KEY` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | +| `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | | `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | -| `BOT_DEBUG` | In production | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default. -| `REDIS_PASSWORD` | When not using FakeRedis | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)). | -| `USE_METRICITY` | When using Metricity | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default. | -| `GITHUB_API_KEY` | When you wish to interact with GitHub | The API key to interact with GitHub, for example to download files for the branding manager. -| `METABASE_USERNAME` | When you wish to interact with Metabase | The username for a Metabase admin account. -| `METABASE_PASSWORD` | When you wish to interact with Metabase | The password for a Metabase admin account. +| `BOT_DEBUG` | In production | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default. | +| `REDIS_PASSWORD` | When not using FakeRedis | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)). | +| `USE_METRICITY` | When using Metricity | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default. | +| `GITHUB_API_KEY` | When you wish to interact with GitHub | The API key to interact with GitHub, for example to download files for the branding manager. | +| `METABASE_USERNAME` | When you wish to interact with Metabase | The username for a Metabase admin account. | +| `METABASE_PASSWORD` | When you wish to interact with Metabase | The password for a Metabase admin account. | --- From f197b0462112fb2160f330eda8d267ff6d242e24 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 01:35:48 +0100 Subject: [PATCH 05/51] add a first explanation of how the `.env.server` should be used --- .../guides/pydis-guides/contributing/bot.md | 55 +++++++++++++++++-- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 6abc34d80..62e3b64f0 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -78,13 +78,60 @@ This file will contain the extracted ids from your newly created server which ar Congratulations, you have finished the configuration & can now start [running your bot](#run-it-) #### .env.server -Entering the directory of the cloned code, you will find a file named `config-default.yml`. +All server configuration values are saved in a file called `.env.server`, which needs to be at the root directory of the cloned code. This file contains the various configurations we use to make the bot run on the Python Discord server, such as channel and role IDs, and the emojis it works with. It also contains configurations such as how long it takes for a help channel to time out, and how many messages a user needs to voice-verify. -To run the bot in your test server, you will need to override some of those configurations. -Create and open a new file in the directory called `config.yml`. Alternatively, copy the `config-default.yml` file and rename the copy to `config.yml`. -The bot will first look at the items in `config.yml`, and will fall back to `config-default.yml` only if necessary. Note that you don't have to specify all items in `config.yml`, just the ones you want to override such as channel IDs. +If you decided to use the bootstrapping script, you'll find that this file has already been created (which we recommend), +otherwise you'll need to create it manually. + +To run the bot in your test server, you will **only** need to add the **necessary** configuration values for the channels/roles/categories, etc. +that you'll be using for testing + +Let's take an example where we suppose we'll only be testing a feature that needs the `announcements` channel. + +`constants.py` + +```py + +from pydantic import Field + +class EnvConfig: + # Defines from where & how Pydantic will be looking for env variables + ... + +class _Channels(EnvConfig): + + EnvConfig.Config.env_prefix = "channels." + + announcements: int = Field(default=123) + changelog: int = Field(default=456) + +# Instantiate the class & load the configuration +Channels = _Channels() +``` + +`.env.server` file + +```text +channels.announcements=789 +``` + +When you launch your bot, `pydantic` will load up the server constants from the `.env.server` file if they exist. + +Each constants class will define its own prefix, which will make `pydantic` look for variables that will look like `{{env_prefix}}{{attribute_name}}` in the environment files + +In our example, this will imply that pydantic will look for both `channels.announcements` and `channels.changelog` in the `.env.server` file. + +As you can see here, only `channels.announcements` has been defined in the `.env.server` file since it's the only one needed, which will tell `pydantic` +to use the value **789** for the `announcements` attribute instead of the default **456**, and use the default value for the `changelog` attribute + +```python +>>> Channels.announcements +789 +>>> Channels.changelong +456 +``` See [here](../obtaining-discord-ids) for help with obtaining Discord IDs. From 99aa19f9b8e8610c688c418448ecabdcc463b4f2 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 10:51:21 +0100 Subject: [PATCH 06/51] make the notes inline --- .../resources/guides/pydis-guides/contributing/bot.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 62e3b64f0..129adceb9 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -41,9 +41,7 @@ You now have both the bot's code and a server to run it on. It's time you to con To make setup much easier, there is a file called `bootstrap_config.py` that represents a script to bootstrap the configuration for you and help you get started immediately without having to spend much time copying ids from your newly created server into your configuration file. -**Note** - -This phase can be skipped and done manually, but would require extra manual work. +**Note**: This phase can be skipped and done manually, but would require extra manual work. ##### 1. Script setup ##### 1.1. Environment variables @@ -56,9 +54,7 @@ GUILD_ID=YourDiscordTestServerIdHere ``` See [here](../creating-bot-account) for help with obtaining the bot token and [here](obtaining-discord-ids.md#guild-id) for help with obtaining the guild's id -**Note** - -The `.env` file will be ignored by commits. +**Note**: The `.env` file will be ignored by commits. ##### 1.2 Setting up the script environment The bootstrapping script is Python code like any other. To run it locally, you will need the right version of Python with the necessary packages installed: 1. Make sure you follow steps `1` and `2` [here](#setting-up-a-development-environment) From abf77eba35116e4ed0a2a234ed4a2235bc54ca85 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 11:10:20 +0100 Subject: [PATCH 07/51] divide config into auto & manual sections --- .../guides/pydis-guides/contributing/bot.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 129adceb9..015713532 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -36,8 +36,9 @@ If your bot fails to start with a `PrivilegedIntentsRequired` exception, this in ### Configure the Bot You now have both the bot's code and a server to run it on. It's time you to connect the two by changing the bot's configurations. +This can be done either automatically or manually, and we'll be detailing the steps for both. -#### Scaffolding the configuration +#### Automatic configuration To make setup much easier, there is a file called `bootstrap_config.py` that represents a script to bootstrap the configuration for you and help you get started immediately without having to spend much time copying ids from your newly created server into your configuration file. @@ -63,17 +64,24 @@ The bootstrapping script is Python code like any other. To run it locally, you w #### 2. Running the script Once the script setup phase is complete, all that is left is to run it. -To do this, you'll simply need to run the `configure` poetry task like thise +To do this, you'll simply need to run the `configure` poetry task like this ```shell $ poetry run task configure ``` +or, without poetry and from the root directory + +```shell +python3 -m bootstrap_config +``` + Once the script has finished running, you'll notice the creation of a new file called [`.env.server`](#envserver) at your project's root directory. This file will contain the extracted ids from your newly created server which are necessary for your bot to run. Congratulations, you have finished the configuration & can now start [running your bot](#run-it-) -#### .env.server +#### Manual configuration +##### .env.server All server configuration values are saved in a file called `.env.server`, which needs to be at the root directory of the cloned code. This file contains the various configurations we use to make the bot run on the Python Discord server, such as channel and role IDs, and the emojis it works with. It also contains configurations such as how long it takes for a help channel to time out, and how many messages a user needs to voice-verify. @@ -529,11 +537,11 @@ We understand this is tedious and are working on a better solution for setting u
-#### .env +##### .env The second file you need to create is the one containing the environment variables, and needs to be named `.env`. Inside, add the line `BOT_TOKEN=YourDiscordBotTokenHere`. See [here](../creating-bot-account) for help with obtaining the bot token. -The `.env` file will be ignored by commits. +**Note**: The `.env` file will be ignored by commits. --- From 496da05cccc16dbb71fbf4ff116d562c8c3cc134 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 12:16:46 +0100 Subject: [PATCH 08/51] blunt replacement of the embedded .yaml config --- .../guides/pydis-guides/contributing/bot.md | 748 ++++++++++-------- 1 file changed, 397 insertions(+), 351 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 015713532..7ab26008f 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -141,7 +141,7 @@ See [here](../obtaining-discord-ids) for help with obtaining Discord IDs.

From 7d372a3b12fd6cbff9b2d928ece6ad6f45c9bb2d Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 12:45:55 +0100 Subject: [PATCH 09/51] update recommendeations of values that need overriding --- .../guides/pydis-guides/contributing/bot.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 7ab26008f..cec2ab637 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -549,22 +549,22 @@ filters.ping_everyone=true
-If you don't wish to use the provided `config.yml` above, these are the main sections in `config-default.yml` that need overriding: -* `guild.id` -* `guild.categories` -* `guild.channels` -* `guild.roles` -* `guild.webhooks` -* `style.emojis` +If you don't wish to use the provided `env.server` above, the main values that need overriding are **all** the ones prefixed with: + +* `guild.` +* `categories.` +* `channels.` +* `roles.` +* `webhooks.` +* `emojis.` Additionally: -* At this stage, set `bot.redis.use_fakeredis` to `true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). -* Set `urls.site_api` to `!JOIN [*DOMAIN, "/api"]`. +* At this stage, set `redis.use_fakeredis` to `true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). * Set `urls.site_schema` and `urls.site_api_schema` to `"http://"`. -We understand this is tedious and are working on a better solution for setting up test servers. +We understand this is tedious which is why we **recommend** using the [automatic configuration setup](#automatic-configuration)
From 281bbf34f9e25dde8af1e99cb7971348a589d689 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 12:58:30 +0100 Subject: [PATCH 10/51] update all mentions of config & default-config.yaml --- .../guides/pydis-guides/contributing/bot.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index cec2ab637..6f717b9be 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -615,7 +615,7 @@ You are now almost ready to run the Python bot. The simplest way to do so is wit
-In your `config.yml` file: +In your `.env.server` file: * Set `urls.site` to `"web:8000"`. * If you wish to work with snekbox set the following: @@ -634,7 +634,7 @@ Your bot is now running, but this method makes debugging with an IDE a fairly in The advantage of this method is that you can run the bot's code in your preferred editor, with debugger and all, while keeping all the setup of the bot's various dependencies inside Docker. * Append the following line to your `.env` file: `BOT_API_KEY=badbot13m0n8f570f942013fc818f234916ca531`. -* In your `config.yml` file, set `urls.site` to `"localhost:8000"`. If you wish to keep using `web:8000`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. +* In your `.env.server` file, set `urls.site` to `"localhost:8000"`. If you wish to keep using `web:8000`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. * To work with snekbox, set `urls.snekbox_eval_api` to `"http://localhost:8060/eval"` and `urls.snekbox_311_eval_api` to `"http://localhost:8065/eval"` You will need to start the services separately, but if you got the previous section with Docker working, that's pretty simple: @@ -679,7 +679,7 @@ You can run additional services on the host, but this guide won't go over how to If possible, prefer to start the services through Docker to replicate the production environment as much as possible. The site, however, is a mandatory service for the bot. -Refer to the [previous section](#with-the-bot-running-locally) and the [site contributing guide](../site) to learn how to start it on the host, in which case you will need to change `urls.site` in `config.yml` to wherever the site is being hosted. +Refer to the [previous section](#with-the-bot-running-locally) and the [site contributing guide](../site) to learn how to start it on the host, in which case you will need to change `urls.site` in `.env.server` to wherever the site is being hosted. --- ### Development Tips @@ -721,15 +721,15 @@ We are always open to more statistics so add as many as you can! --- ### Optional: Working with Redis -In [Configure the Bot](#configyml) you were asked to set `bot.redis.use_fakeredis` to `true`. If you do not need to work on features that rely on Redis, this is enough. Fakeredis will give the illusion that features relying on Redis are saving information properly, but restarting the bot or the specific cog will wipe that information. +In [Configure the Bot](#envserver) you were asked to set `redis.use_fakeredis` to `true`. If you do not need to work on features that rely on Redis, this is enough. Fakeredis will give the illusion that features relying on Redis are saving information properly, but restarting the bot or the specific cog will wipe that information. -If you are working on a feature that relies on Redis, you will need to enable Redis to make sure persistency is achieved for the feature across restarts. The first step towards that is going to `config.yml` and setting `bot.redis.use_fakeredis` to `false`. +If you are working on a feature that relies on Redis, you will need to enable Redis to make sure persistency is achieved for the feature across restarts. The first step towards that is going to `.env.server` and setting `redis.use_fakeredis` to `false`. #### Starting Redis in Docker (Recommended) -If you're using the Docker image provided in the project's Docker Compose, open your `config.yml` file. If you're running the bot in Docker, set `bot.redis.host` to `redis`, and if you're running it on the host set it to `localhost`. Set `bot.redis.password` to `null`. +If you're using the Docker image provided in the project's Docker Compose, open your `.env.server` file. If you're running the bot in Docker, set `redis.host` to `redis`, and if you're running it on the host set it to `localhost`. Set `bot.redis.password` to `""`. #### Starting Redis Using Other Methods -You can run your own instance of Redis, but in that case you will need to correctly set `bot.redis.host` and `bot.redis.port`, and the `bot.redis.password` value in `config-default.yml` should not be overridden. Then, enter the `.env` file, and set `REDIS_PASSWORD` to whatever password you set. +You can run your own instance of Redis, but in that case you will need to correctly set `redis.host` and `redis.port`, and the `redis.password` value in `constants.py` should not be overridden. Then, enter the `.env` file, and set `REDIS_PASSWORD` to whatever password you set. --- From 36ce014fe91553bd3ddd9411ff25be58209cd755 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 13:00:56 +0100 Subject: [PATCH 11/51] update info of the `GUILD_ID` env var --- .../content/resources/guides/pydis-guides/contributing/bot.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 6f717b9be..6d9be90ee 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -768,7 +768,8 @@ The following is a list of all available environment variables used by the bot: | Variable | Required | Description | |----------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | -| `GUILD_ID` | Always | Your Discord test server's id (see [Set Up a Bot Account](#set-up-a-bot-account)). | +| `GUILD_ID` | When using the bootstrapping script | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | +| `GUILD_ID` | When using the bootstrapping script | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | | `BOT_API_KEY` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | | `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | | `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | From 217d874ba0c66d3e2708e899863f34bee65ad9dd Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 13:04:24 +0100 Subject: [PATCH 12/51] remove duplicated line in appendix --- .../content/resources/guides/pydis-guides/contributing/bot.md | 1 - 1 file changed, 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 6d9be90ee..a2b584437 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -769,7 +769,6 @@ The following is a list of all available environment variables used by the bot: |----------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | | `GUILD_ID` | When using the bootstrapping script | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | -| `GUILD_ID` | When using the bootstrapping script | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | | `BOT_API_KEY` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | | `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | | `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | From a5e68bc4962a0c2e7b71a7f59cbdccf3b220725a Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 13:09:45 +0100 Subject: [PATCH 13/51] update guide links --- .../content/resources/guides/pydis-guides/contributing/bot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index a2b584437..0a7a116c4 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -53,13 +53,13 @@ Inside, add the following two lines: BOT_TOKEN=YourDiscordBotTokenHere GUILD_ID=YourDiscordTestServerIdHere ``` -See [here](../creating-bot-account) for help with obtaining the bot token and [here](obtaining-discord-ids.md#guild-id) for help with obtaining the guild's id +See [here](../creating-bot-account) for help with obtaining the bot token and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's id **Note**: The `.env` file will be ignored by commits. ##### 1.2 Setting up the script environment The bootstrapping script is Python code like any other. To run it locally, you will need the right version of Python with the necessary packages installed: 1. Make sure you follow steps `1` and `2` [here](#setting-up-a-development-environment) -2. [Install the `config-bootstrap` dependency group](installing-project-dependencies.md#installing-specific-dependency-groups). +2. [Install the `config-bootstrap` dependency group](../installing-project-dependencies#installing-specific-dependency-groups). #### 2. Running the script From 4364bad23223ae6e271d9d60ef30787be2be7d51 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 13:11:50 +0100 Subject: [PATCH 14/51] update the run it link --- .../resources/guides/pydis-guides/contributing/bot.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 0a7a116c4..dba4b280d 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -47,6 +47,7 @@ without having to spend much time copying ids from your newly created server int ##### 1. Script setup ##### 1.1. Environment variables You will need to create a file called `.env` which will contain two required values for the script to work: `BOT_TOKEN` and `GUILD_ID` + Inside, add the following two lines: ```text @@ -58,6 +59,7 @@ See [here](../creating-bot-account) for help with obtaining the bot token and [h **Note**: The `.env` file will be ignored by commits. ##### 1.2 Setting up the script environment The bootstrapping script is Python code like any other. To run it locally, you will need the right version of Python with the necessary packages installed: + 1. Make sure you follow steps `1` and `2` [here](#setting-up-a-development-environment) 2. [Install the `config-bootstrap` dependency group](../installing-project-dependencies#installing-specific-dependency-groups). @@ -78,7 +80,8 @@ python3 -m bootstrap_config Once the script has finished running, you'll notice the creation of a new file called [`.env.server`](#envserver) at your project's root directory. This file will contain the extracted ids from your newly created server which are necessary for your bot to run. -Congratulations, you have finished the configuration & can now start [running your bot](#run-it-) + +**Congratulations**, you have finished the configuration & can now start [running your bot](#run-it) #### Manual configuration ##### .env.server From 493adc94f96f7444e9b449795d397d2213a78788 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 13:14:00 +0100 Subject: [PATCH 15/51] put constants.py inside code tags --- .../content/resources/guides/pydis-guides/contributing/bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index dba4b280d..709b57b3d 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -578,7 +578,7 @@ We understand this is tedious which is why we **recommend** using the [automatic
From 2af659981711cabf817f0f4b1805b4aa98ff69f2 Mon Sep 17 00:00:00 2001 From: Amrou Date: Sat, 25 Feb 2023 13:25:18 +0100 Subject: [PATCH 17/51] add old config comments --- .../guides/pydis-guides/contributing/bot.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index a6d41bb6b..eb87c1839 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -155,6 +155,10 @@ See [here](../obtaining-discord-ids) for help with obtaining Discord IDs.
                 
 
+##### <<  Replace the following � characters with the channel IDs in your test server  >> #####
+#  This assumes the template was used: https://discord.new/zmHtscpYN9E3
+
+
 # Channels configuration
 channels.announcements=�
 channels.changelog=�
@@ -232,6 +236,9 @@ channels.big_brother_logs=�
 channels.duck_pond=�
 channels.roles=�
 
+##### << Replace the following � characters with the role IDs in your test server >> #####
+
+
 # Roles configuration
 
 roles.advent_of_code=�
@@ -273,7 +280,7 @@ roles.patreon_tier_1=�
 roles.patreon_tier_2=�
 roles.patreon_tier_3=�
 
-
+##### << Replace the following � characters with the category IDs in your test server >> #####
 
 # Categories configuration
 
@@ -287,12 +294,15 @@ categories.voice=�
 ### 2021 Summer Code Jam
 categories.summer_code_jam=�
 
+##### << Replace the following � character with the ID of your test server >> #####
 
 # Guild configuration
 guild.id=�
 guild.invite="https://discord.gg/python"
 
 
+##### << Replace the following � characters with the webhook IDs in your test server >> #####
+
 # Webhooks configuration
 
 webhooks.big_brother.id=�
@@ -435,6 +445,10 @@ urls.site_api_schema="http://"
 urls.connect_max_retries=3
 urls.connect_cooldown=5
 
+##### << The bot shouldn't fail without these, but commands adding specific emojis won't work. >> #####
+##### << You should at least set the trashcan. Set the incidents emojis if relevant. >> #####
+
+
 
 # Emojis configuration
 emojis.badge_bug_hunter="<:bug_hunter_lvl1:743882896372269137>"
@@ -531,6 +545,8 @@ icons.voice_state_blue="https://cdn.discordapp.com/emojis/656899769662439456.png
 icons.voice_state_green="https://cdn.discordapp.com/emojis/656899770094452754.png"
 icons.voice_state_red="https://cdn.discordapp.com/emojis/656899769905709076.png"
 
+##### << Optional - If you don't care about the filtering, help channel and py-news cogs, ignore the rest of this file >> #####
+
 # Filters configuration
 filters.filter_domains=true
 filters.filter_everyone_ping=true

From e1100b443844d4e9935e661e63ba352d867fd647 Mon Sep 17 00:00:00 2001
From: Amrou 
Date: Sat, 25 Feb 2023 19:53:33 +0100
Subject: [PATCH 18/51] remove usage of the Field class

---
 .../resources/guides/pydis-guides/contributing/bot.md       | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index eb87c1839..dbded02ac 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -101,8 +101,6 @@ Let's take an example where we suppose we'll only be testing a feature that need
 
 ```py
 
-from pydantic import Field
-
 class EnvConfig:
     # Defines from where & how Pydantic will be looking for env variables
     ...
@@ -111,8 +109,8 @@ class _Channels(EnvConfig):
 
     EnvConfig.Config.env_prefix = "channels."
 
-    announcements: int = Field(default=123)
-    changelog: int = Field(default=456)
+    announcements = 123
+    changelog = 456
 
 # Instantiate the class & load the configuration
 Channels = _Channels()

From 67db760b8c05f9d2ec57930edfabedcb4ab11978 Mon Sep 17 00:00:00 2001
From: Amrou 
Date: Sun, 26 Feb 2023 01:18:26 +0100
Subject: [PATCH 19/51] update appendix to use the "." separator

---
 .../guides/pydis-guides/contributing/bot.md   | 38 +++++++++----------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index dbded02ac..83f541e1d 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -46,13 +46,13 @@ without having to spend much time copying ids from your newly created server int
 
 ##### 1. Script setup
 ##### 1.1. Environment variables
-You will need to create a file called `.env` which will contain two required values for the script to work: `BOT_TOKEN` and `GUILD_ID`
+You will need to create a file called `.env` which will contain two required values for the script to work: `BOT.TOKEN` and `GUILD.ID`
 
 Inside, add the following two lines:
 
 ```text
-BOT_TOKEN=YourDiscordBotTokenHere
-GUILD_ID=YourDiscordTestServerIdHere
+BOT.TOKEN=YourDiscordBotTokenHere
+GUILD.ID=YourDiscordTestServerIdHere
 ```
 See [here](../creating-bot-account) for help with obtaining the bot token and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's id
 
@@ -604,7 +604,7 @@ We understand this is tedious which is why we **recommend** using the [automatic
 
 ##### .env
 The second file you need to create is the one containing the environment variables, and needs to be named `.env`.
-Inside, add the line `BOT_TOKEN=YourDiscordBotTokenHere`. See [here](../creating-bot-account) for help with obtaining the bot token.
+Inside, add the line `BOT.TOKEN=YourDiscordBotTokenHere`. See [here](../creating-bot-account) for help with obtaining the bot token.
 
 **Note**: The `.env` file will be ignored by commits.
 
@@ -652,7 +652,7 @@ Your bot is now running, but this method makes debugging with an IDE a fairly in
 #### With the Bot Running Locally
 The advantage of this method is that you can run the bot's code in your preferred editor, with debugger and all, while keeping all the setup of the bot's various dependencies inside Docker.
 
-* Append the following line to your `.env` file: `BOT_API_KEY=badbot13m0n8f570f942013fc818f234916ca531`.
+* Append the following line to your `.env` file: `API_KEYS.SITE_API=badbot13m0n8f570f942013fc818f234916ca531`.
 * In your `.env.server` file, set `urls.site` to `"localhost:8000"`. If you wish to keep using `web:8000`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set.
 * To work with snekbox, set `urls.snekbox_eval_api` to `"http://localhost:8060/eval"` and `urls.snekbox_311_eval_api` to `"http://localhost:8065/eval"`
 
@@ -748,7 +748,7 @@ If you are working on a feature that relies on Redis, you will need to enable Re
 If you're using the Docker image provided in the project's Docker Compose, open your `.env.server` file. If you're running the bot in Docker, set `redis.host` to `redis`, and if you're running it on the host set it to `localhost`. Set `bot.redis.password` to `""`.
 
 #### Starting Redis Using Other Methods
-You can run your own instance of Redis, but in that case you will need to correctly set `redis.host` and `redis.port`, and the `redis.password` value in `constants.py` should not be overridden. Then, enter the `.env` file, and set `REDIS_PASSWORD` to whatever password you set.
+You can run your own instance of Redis, but in that case you will need to correctly set `redis.host` and `redis.port`, and the `redis.password` value in `constants.py` should not be overridden. Then, enter the `.env` file, and set `REDIS.PASSWORD` to whatever password you set.
 
 ---
 
@@ -784,19 +784,19 @@ If you find any bugs in the bot or would like to request a feature, feel free to
 ### Appendix: Full ENV File Options
 The following is a list of all available environment variables used by the bot:
 
-| Variable             | Required                                        | Description                                                                                                                                                                                                                                         |
-|----------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| `BOT_TOKEN`          | Always                                          | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)).                                                                                                                                                               |
-| `GUILD_ID`           | When using the bootstrapping script             | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)).                                                                                                                                                                  |
-| `BOT_API_KEY`        | When running bot without Docker                 | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below.                                                                |
-| `BOT_SENTRY_DSN`     | When connecting the bot to sentry               | The DSN of the sentry monitor.                                                                                                                                                                                                                      |
-| `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. |
-| `BOT_DEBUG`          | In production                                   | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default.                                                                                                                        |
-| `REDIS_PASSWORD`     | When not using FakeRedis                        | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)).                                                                                                                                   |
-| `USE_METRICITY`      | When using Metricity                            | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default.                                                                |
-| `GITHUB_API_KEY`     | When you wish to interact with GitHub           | The API key to interact with GitHub, for example to download files for the branding manager.                                                                                                                                                        |
-| `METABASE_USERNAME`  | When you wish to interact with Metabase         | The username for a Metabase admin account.                                                                                                                                                                                                          |
-| `METABASE_PASSWORD`  | When you wish to interact with Metabase         | The password for a Metabase admin account.                                                                                                                                                                                                          |
+| Variable            | Required                                        | Description                                                                                                                                                                                                                                         |
+|---------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `BOT.TOKEN`         | Always                                          | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)).                                                                                                                                                               |
+| `GUILD.ID`          | When using the bootstrapping script             | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)).                                                                                                                                                                  |
+| `API_KEYS.SITE_API` | When running bot without Docker                 | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below.                                                                |
+| `SENTRY_DSN`        | When connecting the bot to sentry               | The DSN of the sentry monitor.                                                                                                                                                                                                                      |
+| `TRACE_LOGGERS `    | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. |
+| `DEBUG`             | In production                                   | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default.                                                                                                                        |
+| `REDIS.PASSWORD`    | When not using FakeRedis                        | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)).                                                                                                                                   |
+| `USE_METRICITY`     | When using Metricity                            | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default.                                                                |
+| `API_KEYS.GITHUB`   | When you wish to interact with GitHub           | The API key to interact with GitHub, for example to download files for the branding manager.                                                                                                                                                        |
+| `METABASE.USERNAME` | When you wish to interact with Metabase         | The username for a Metabase admin account.                                                                                                                                                                                                          |
+| `METABASE.PASSWORD` | When you wish to interact with Metabase         | The password for a Metabase admin account.                                                                                                                                                                                                          |
 
 ---
 

From 70f354c43ad77ed5c5bbce7b81e4dd743e90362d Mon Sep 17 00:00:00 2001
From: Amrou 
Date: Sun, 26 Feb 2023 01:22:39 +0100
Subject: [PATCH 20/51] prefix sentry_dsn & trace_loggers with `bot.`

---
 .../guides/pydis-guides/contributing/bot.md   | 26 +++++++++----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index 83f541e1d..f20a28290 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -784,19 +784,19 @@ If you find any bugs in the bot or would like to request a feature, feel free to
 ### Appendix: Full ENV File Options
 The following is a list of all available environment variables used by the bot:
 
-| Variable            | Required                                        | Description                                                                                                                                                                                                                                         |
-|---------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| `BOT.TOKEN`         | Always                                          | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)).                                                                                                                                                               |
-| `GUILD.ID`          | When using the bootstrapping script             | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)).                                                                                                                                                                  |
-| `API_KEYS.SITE_API` | When running bot without Docker                 | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below.                                                                |
-| `SENTRY_DSN`        | When connecting the bot to sentry               | The DSN of the sentry monitor.                                                                                                                                                                                                                      |
-| `TRACE_LOGGERS `    | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. |
-| `DEBUG`             | In production                                   | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default.                                                                                                                        |
-| `REDIS.PASSWORD`    | When not using FakeRedis                        | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)).                                                                                                                                   |
-| `USE_METRICITY`     | When using Metricity                            | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default.                                                                |
-| `API_KEYS.GITHUB`   | When you wish to interact with GitHub           | The API key to interact with GitHub, for example to download files for the branding manager.                                                                                                                                                        |
-| `METABASE.USERNAME` | When you wish to interact with Metabase         | The username for a Metabase admin account.                                                                                                                                                                                                          |
-| `METABASE.PASSWORD` | When you wish to interact with Metabase         | The password for a Metabase admin account.                                                                                                                                                                                                          |
+| Variable             | Required                                        | Description                                                                                                                                                                                                                                         |
+|----------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `BOT.TOKEN`          | Always                                          | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)).                                                                                                                                                               |
+| `GUILD.ID`           | When using the bootstrapping script             | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)).                                                                                                                                                                  |
+| `API_KEYS.SITE_API`  | When running bot without Docker                 | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below.                                                                |
+| `BOT.SENTRY_DSN`     | When connecting the bot to sentry               | The DSN of the sentry monitor.                                                                                                                                                                                                                      |
+| `BOT.TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. |
+| `DEBUG`              | In production                                   | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default.                                                                                                                        |
+| `REDIS.PASSWORD`     | When not using FakeRedis                        | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)).                                                                                                                                   |
+| `USE_METRICITY`      | When using Metricity                            | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default.                                                                |
+| `API_KEYS.GITHUB`    | When you wish to interact with GitHub           | The API key to interact with GitHub, for example to download files for the branding manager.                                                                                                                                                        |
+| `METABASE.USERNAME`  | When you wish to interact with Metabase         | The username for a Metabase admin account.                                                                                                                                                                                                          |
+| `METABASE.PASSWORD`  | When you wish to interact with Metabase         | The password for a Metabase admin account.                                                                                                                                                                                                          |
 
 ---
 

From bfa955417ae582a797c31dd462bb0279fb67c64e Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Tue, 28 Feb 2023 09:36:53 +0100
Subject: [PATCH 21/51] Update the note about ignoring .env

---
 .../content/resources/guides/pydis-guides/contributing/bot.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index f20a28290..03c2444b8 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -56,7 +56,7 @@ GUILD.ID=YourDiscordTestServerIdHere
 ```
 See [here](../creating-bot-account) for help with obtaining the bot token and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's id
 
-**Note**: The `.env` file will be ignored by commits.
+**Note**: The `.env` is and should remain ignored by git, otherwise you risk pushing sensitive information.
 ##### 1.2 Setting up the script environment
 The bootstrapping script is Python code like any other. To run it locally, you will need the right version of Python with the necessary packages installed:
 
@@ -606,7 +606,7 @@ We understand this is tedious which is why we **recommend** using the [automatic
 The second file you need to create is the one containing the environment variables, and needs to be named `.env`.
 Inside, add the line `BOT.TOKEN=YourDiscordBotTokenHere`. See [here](../creating-bot-account) for help with obtaining the bot token.
 
-**Note**: The `.env` file will be ignored by commits.
+**Note**: The `.env` is and should remain ignored by git, otherwise you risk pushing sensitive information.
 
 ---
 

From 30033da4c74df1ae47e30f4a63eef7085b06712f Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Tue, 28 Feb 2023 09:40:56 +0100
Subject: [PATCH 22/51] Use "Python program" instead of "Python code" to
 describe the script

---
 .../content/resources/guides/pydis-guides/contributing/bot.md  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index 03c2444b8..c3189bbee 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -58,7 +58,8 @@ See [here](../creating-bot-account) for help with obtaining the bot token and [h
 
 **Note**: The `.env` is and should remain ignored by git, otherwise you risk pushing sensitive information.
 ##### 1.2 Setting up the script environment
-The bootstrapping script is Python code like any other. To run it locally, you will need the right version of Python with the necessary packages installed:
+The bootstrapping script is a Python program so you will need a compatible Python version and the necessary dependencies installed,
+which are all detailed here:
 
 1. Make sure you follow steps `1` and `2` [here](#setting-up-a-development-environment)
 2. [Install the `config-bootstrap` dependency group](../installing-project-dependencies#installing-specific-dependency-groups).

From fefe1e7b80ee6d8f162695d47260d818a414e034 Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Tue, 28 Feb 2023 09:45:03 +0100
Subject: [PATCH 23/51] Mention that only necessary component IDs needs to be
 added when configuring manually

---
 .../resources/guides/pydis-guides/contributing/bot.md        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index c3189bbee..4322d0a6f 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -93,8 +93,9 @@ It also contains configurations such as how long it takes for a help channel to
 If you decided to use the bootstrapping script, you'll find that this file has already been created (which we recommend),
 otherwise you'll need to create it manually.
 
-To run the bot in your test server, you will **only** need to add the **necessary** configuration values for the channels/roles/categories, etc.
-that you'll be using for testing
+If you decide to set the configuration values manually, you will **only** need to set the values for the channels, roles, categories, etc. 
+that are used by the component you are developing.
+
 
 Let's take an example where we suppose we'll only be testing a feature that needs the `announcements` channel.
 

From 1c23a1715496332a25f2548e208e4e09c31d8be9 Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Tue, 28 Feb 2023 09:50:15 +0100
Subject: [PATCH 24/51] use concrete ids for the channel examples

---
 .../guides/pydis-guides/contributing/bot.md          | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index 4322d0a6f..c991d4321 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -111,8 +111,8 @@ class _Channels(EnvConfig):
 
     EnvConfig.Config.env_prefix = "channels."
 
-    announcements = 123
-    changelog = 456
+    announcements = 1079790565794779156
+    changelog = 1077877318564991006
 
 # Instantiate the class & load the configuration
 Channels = _Channels()
@@ -121,7 +121,7 @@ Channels = _Channels()
 `.env.server` file
 
 ```text
-channels.announcements=789
+channels.announcements=1077875228002234398
 ```
 
 When you launch your bot, `pydantic` will load up the server constants from the `.env.server` file if they exist.
@@ -131,13 +131,13 @@ Each constants class will define its own prefix, which will make `pydantic` look
 In our example, this will imply that pydantic will look for both `channels.announcements` and `channels.changelog` in the `.env.server` file.
 
 As you can see here, only `channels.announcements` has been defined in the `.env.server` file since it's the only one needed, which will tell `pydantic`
-to use the value **789** for the `announcements` attribute instead of the default **456**, and use the default value for the `changelog` attribute
+to use the value **1077875228002234398** for the `announcements` attribute instead of the default **1079790565794779156**, and use the default value for the `changelog` attribute
 
 ```python
 >>> Channels.announcements
-789
+1077875228002234398
 >>> Channels.changelong
-456
+1077877318564991006
 ```
 
 See [here](../obtaining-discord-ids) for help with obtaining Discord IDs.

From a3a54a1c69463429520d8cf8530f8c3e95b5c86f Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Tue, 28 Feb 2023 09:53:01 +0100
Subject: [PATCH 25/51] Appease linter

---
 .../content/resources/guides/pydis-guides/contributing/bot.md   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index c991d4321..65f0d8182 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -93,7 +93,7 @@ It also contains configurations such as how long it takes for a help channel to
 If you decided to use the bootstrapping script, you'll find that this file has already been created (which we recommend),
 otherwise you'll need to create it manually.
 
-If you decide to set the configuration values manually, you will **only** need to set the values for the channels, roles, categories, etc. 
+If you decide to set the configuration values manually, you will **only** need to set the values for the channels, roles, categories, etc.
 that are used by the component you are developing.
 
 

From adc8540bd1ded4134552b42dadb13a8ff228f660 Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Thu, 2 Mar 2023 14:48:24 +0100
Subject: [PATCH 26/51] update all instances of bootstrap_config with botstrap

---
 .../content/resources/guides/pydis-guides/contributing/bot.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index 65f0d8182..85198f8b2 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -39,7 +39,7 @@ You now have both the bot's code and a server to run it on. It's time you to con
 This can be done either automatically or manually, and we'll be detailing the steps for both.
 
 #### Automatic configuration
-To make setup much easier, there is a file called `bootstrap_config.py` that represents a script to bootstrap the configuration for you and help you get started immediately
+To make setup much easier, there is a file called `botstrap.py` that represents a script to bootstrap the configuration for you and help you get started immediately
 without having to spend much time copying ids from your newly created server into your configuration file.
 
 **Note**: This phase can be skipped and done manually, but would require extra manual work.
@@ -76,7 +76,7 @@ $ poetry run task configure
 or, without poetry and from the root directory
 
 ```shell
-python3 -m bootstrap_config
+python3 -m botstrap
 ```
 
 Once the script has finished running, you'll notice the creation of a new file called [`.env.server`](#envserver) at your project's root directory.

From 2fc356c15e281240bff766a2a83ae92c6742c199 Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Thu, 2 Mar 2023 15:01:53 +0100
Subject: [PATCH 27/51] add a section that details help forum setup

---
 .../guides/pydis-guides/contributing/bot.md    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index 85198f8b2..7aa18ccca 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -612,6 +612,24 @@ Inside, add the line `BOT.TOKEN=YourDiscordBotTokenHere`. See [here](../creating
 
 ---
 
+### Working with the help forum
+If you will be working on a feature that includes the python help forum, you will need to use `Forum Channels`.
+
+Forum channels cannot be included in a template, which is why this needs to be done by hand for the time being.
+
+To activate forum channels, your Discord server needs to have the community feature.
+If that's not the case already, here are the steps required to do it:
+1. Go to server settings
+2. Scroll down to the `COMMUNITY` section and click on `Enable Community`
+3. Click on `Get Started` and fill out the necessary info
+
+Once the previous steps are done, all that is left is to:
+1. Create a new channel
+2. Choose the `Forum` type
+3. [Copy its ID](../obtaining-discord-ids#channel-id)
+4. Add the following line to the `.env.server` file: `channels.python_help={newly_created_forum_channel_id}` 
+
+
 ### Run it!
 #### With Docker
 You are now almost ready to run the Python bot. The simplest way to do so is with Docker.

From df9181f99ac329044ec40016a6a82ba8ef7dcc4e Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Thu, 2 Mar 2023 15:22:51 +0100
Subject: [PATCH 28/51] appease linter

---
 .../content/resources/guides/pydis-guides/contributing/bot.md   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index 7aa18ccca..272ba10a8 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -627,7 +627,7 @@ Once the previous steps are done, all that is left is to:
 1. Create a new channel
 2. Choose the `Forum` type
 3. [Copy its ID](../obtaining-discord-ids#channel-id)
-4. Add the following line to the `.env.server` file: `channels.python_help={newly_created_forum_channel_id}` 
+4. Add the following line to the `.env.server` file: `channels.python_help={newly_created_forum_channel_id}`
 
 
 ### Run it!

From 47308422a2a34d9fc66f0c5f7b423b12a775d919 Mon Sep 17 00:00:00 2001
From: shtlrs 
Date: Wed, 8 Mar 2023 12:38:37 +0100
Subject: [PATCH 29/51] update prefix to underscore: _

---
 .../guides/pydis-guides/contributing/bot.md   | 616 +++++++++---------
 1 file changed, 308 insertions(+), 308 deletions(-)

diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
index 272ba10a8..078815430 100644
--- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
+++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md
@@ -46,13 +46,13 @@ without having to spend much time copying ids from your newly created server int
 
 ##### 1. Script setup
 ##### 1.1. Environment variables
-You will need to create a file called `.env` which will contain two required values for the script to work: `BOT.TOKEN` and `GUILD.ID`
+You will need to create a file called `.env` which will contain two required values for the script to work: `BOT_TOKEN` and `GUILD_ID`
 
 Inside, add the following two lines:
 
 ```text
-BOT.TOKEN=YourDiscordBotTokenHere
-GUILD.ID=YourDiscordTestServerIdHere
+BOT_TOKEN=YourDiscordBotTokenHere
+GUILD_ID=YourDiscordTestServerIdHere
 ```
 See [here](../creating-bot-account) for help with obtaining the bot token and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's id
 
@@ -109,7 +109,7 @@ class EnvConfig:
 
 class _Channels(EnvConfig):
 
-    EnvConfig.Config.env_prefix = "channels."
+    EnvConfig.Config.env_prefix = "channels_"
 
     announcements = 1079790565794779156
     changelog = 1077877318564991006
@@ -121,16 +121,16 @@ Channels = _Channels()
 `.env.server` file
 
 ```text
-channels.announcements=1077875228002234398
+channels_announcements=1077875228002234398
 ```
 
 When you launch your bot, `pydantic` will load up the server constants from the `.env.server` file if they exist.
 
 Each constants class will define its own prefix, which will make `pydantic` look for variables that will look like `{{env_prefix}}{{attribute_name}}` in the environment files
 
-In our example, this will imply that pydantic will look for both `channels.announcements` and `channels.changelog` in the `.env.server` file.
+In our example, this will imply that pydantic will look for both `channels_announcements` and `channels_changelog` in the `.env.server` file.
 
-As you can see here, only `channels.announcements` has been defined in the `.env.server` file since it's the only one needed, which will tell `pydantic`
+As you can see here, only `channels_announcements` has been defined in the `.env.server` file since it's the only one needed, which will tell `pydantic`
 to use the value **1077875228002234398** for the `announcements` attribute instead of the default **1079790565794779156**, and use the default value for the `changelog` attribute
 
 ```python
@@ -160,290 +160,290 @@ See [here](../obtaining-discord-ids) for help with obtaining Discord IDs.
 
 
 # Channels configuration
-channels.announcements=�
-channels.changelog=�
-channels.mailing_lists=�
-channels.python_events=�
-channels.python_news=�
-channels.reddit=�
-
-channels.dev_contrib=�
-channels.dev_core=�
-channels.dev_log=�
-
-channels.meta=�
-channels.python_general=�
-
-channels.help_system_forum=�
-
-channels.attachment_log=�
-channels.filter_log=�
-channels.message_log=�
-channels.mod_log=�
-channels.nomination_archive=�
-channels.user_log=�
-channels.voice_log=�
-
-channels.off_topic_0=�
-channels.off_topic_1=�
-channels.off_topic_2=�
-
-channels.bot_commands=�
-channels.discord_bots=�
-channels.esoteric=�
-channels.voice_gate=�
-channels.code_jam_planning=�
+channels_announcements=�
+channels_changelog=�
+channels_mailing_lists=�
+channels_python_events=�
+channels_python_news=�
+channels_reddit=�
+
+channels_dev_contrib=�
+channels_dev_core=�
+channels_dev_log=�
+
+channels_meta=�
+channels_python_general=�
+
+channels_help_system_forum=�
+
+channels_attachment_log=�
+channels_filter_log=�
+channels_message_log=�
+channels_mod_log=�
+channels_nomination_archive=�
+channels_user_log=�
+channels_voice_log=�
+
+channels_off_topic_0=�
+channels_off_topic_1=�
+channels_off_topic_2=�
+
+channels_bot_commands=�
+channels_discord_bots=�
+channels_esoteric=�
+channels_voice_gate=�
+channels_code_jam_planning=�
 
 ### Staff
-channels.admins=�
-channels.admin_spam=�
-channels.defcon=�
-channels.helpers=�
-channels.incidents=�
-channels.incidents_archive=�
-channels.mod_alerts=�
-channels.mod_meta=�
-channels.mods=�
-channels.nominations=�
-channels.nomination_voting=�
-channels.organisation=�
+channels_admins=�
+channels_admin_spam=�
+channels_defcon=�
+channels_helpers=�
+channels_incidents=�
+channels_incidents_archive=�
+channels_mod_alerts=�
+channels_mod_meta=�
+channels_mods=�
+channels_nominations=�
+channels_nomination_voting=�
+channels_organisation=�
 
 ### Staff announcement channels
-channels.admin_announcements=�
-channels.mod_announcements=�
-channels.staff_announcements=�
-channels.staff_info=�
-channels.staff_lounge=�
+channels_admin_announcements=�
+channels_mod_announcements=�
+channels_staff_announcements=�
+channels_staff_info=�
+channels_staff_lounge=�
 
 ### Voice Channels
-channels.admins_voice=�
-channels.code_help_voice_0=�
-channels.code_help_voice_1=�
-channels.general_voice_0=�
-channels.general_voice_1=�
-channels.staff_voice=�
+channels_admins_voice=�
+channels_code_help_voice_0=�
+channels_code_help_voice_1=�
+channels_general_voice_0=�
+channels_general_voice_1=�
+channels_staff_voice=�
 
-channels.black_formatter=�
+channels_black_formatter=�
 
 ### Voice Chat
-channels.code_help_chat_0=�
-channels.code_help_chat_1=�
-channels.staff_voice_chat=�
-channels.voice_chat_0=�
-channels.voice_chat_1=�
+channels_code_help_chat_0=�
+channels_code_help_chat_1=�
+channels_staff_voice_chat=�
+channels_voice_chat_0=�
+channels_voice_chat_1=�
 
-channels.big_brother_logs=�
-channels.duck_pond=�
-channels.roles=�
+channels_big_brother_logs=�
+channels_duck_pond=�
+channels_roles=�
 
 ##### << Replace the following � characters with the role IDs in your test server >> #####
 
 
 # Roles configuration
 
-roles.advent_of_code=�
-roles.announcements=�
-roles.lovefest=�
-roles.pyweek_announcements=�
-roles.revival_of_code=�
-roles.legacy_help_channels_access=�
-
-roles.contributors=�
-roles.help_cooldown=�
-roles.muted=�
-roles.partners=�
-roles.python_community=�
-roles.sprinters=�
-roles.voice_verified=�
+roles_advent_of_code=�
+roles_announcements=�
+roles_lovefest=�
+roles_pyweek_announcements=�
+roles_revival_of_code=�
+roles_legacy_help_channels_access=�
+
+roles_contributors=�
+roles_help_cooldown=�
+roles_muted=�
+roles_partners=�
+roles_python_community=�
+roles_sprinters=�
+roles_voice_verified=�
 
 ### Streaming
-roles.video=�
+roles_video=�
 
 ### Staff
-roles.admins=�
-roles.core_developers=�
-roles.code_jam_event_team=�
-roles.devops=�
-roles.domain_leads=�
-roles.events_lead=�
-roles.helpers=�
-roles.moderators=�
-roles.mod_team=�
-roles.owners=�
-roles.project_leads=�
+roles_admins=�
+roles_core_developers=�
+roles_code_jam_event_team=�
+roles_devops=�
+roles_domain_leads=�
+roles_events_lead=�
+roles_helpers=�
+roles_moderators=�
+roles_mod_team=�
+roles_owners=�
+roles_project_leads=�
 
 ### Code Jam
-roles.jammers=�
+roles_jammers=�
 
 ### Patreon
-roles.patreon_tier_1=�
-roles.patreon_tier_2=�
-roles.patreon_tier_3=�
+roles_patreon_tier_1=�
+roles_patreon_tier_2=�
+roles_patreon_tier_3=�
 
 ##### << Replace the following � characters with the category IDs in your test server >> #####
 
 # Categories configuration
 
-categories.logs=�
-categories.moderators=�
-categories.modmail=�
-categories.appeals=�
-categories.appeals2=�
-categories.voice=�
+categories_logs=�
+categories_moderators=�
+categories_modmail=�
+categories_appeals=�
+categories_appeals2=�
+categories_voice=�
 
 ### 2021 Summer Code Jam
-categories.summer_code_jam=�
+categories_summer_code_jam=�
 
 ##### << Replace the following � character with the ID of your test server >> #####
 
 # Guild configuration
-guild.id=�
-guild.invite="https://discord.gg/python"
+guild_id=�
+guild_invite="https://discord.gg/python"
 
 
 ##### << Replace the following � characters with the webhook IDs in your test server >> #####
 
 # Webhooks configuration
 
-webhooks.big_brother.id=�
-webhooks.dev_log.id=�
-webhooks.duck_pond.id=�
-webhooks.incidents.id=�
-webhooks.incidents_archive.id=�
-webhooks.python_news.id=�
+webhooks_big_brother_id=�
+webhooks_dev_log_id=�
+webhooks_duck_pond_id=�
+webhooks_incidents_id=�
+webhooks_incidents_archive_id=�
+webhooks_python_news_id=�
 
 # Big brother configuration
-big_brother.header_message_limit=15
-big_brother.log_delay=15
+big_brother_header_message_limit=15
+big_brother_log_delay=15
 
 # Code Block configuration
 
-code_block.cooldown_seconds=300
-code_block.minimum_lines=4
+code_block_cooldown_seconds=300
+code_block_minimum_lines=4
 
 
 # Colours configuration
 
-colours.blue=0x3775a8
-colours.bright_green=0x01d277
-colours.orange=0xe67e22
-colours.pink=0xcf84e0
-colours.purple=0xb734eb
-colours.soft_green=0x68c290
-colours.soft_orange=0xf9cb54
-colours.soft_red=0xcd6d6d
-colours.white=0xfffffe
-colours.yellow=0xffd241
+colours_blue=0x3775a8
+colours_bright_green=0x01d277
+colours_orange=0xe67e22
+colours_pink=0xcf84e0
+colours_purple=0xb734eb
+colours_soft_green=0x68c290
+colours_soft_orange=0xf9cb54
+colours_soft_red=0xcd6d6d
+colours_white=0xfffffe
+colours_yellow=0xffd241
 
 # Free configuration
-free.activity_timeout=600
-free.cooldown_per=60.0
-free.cooldown_rate=1
+free_activity_timeout=600
+free_cooldown_per=60.0
+free_cooldown_rate=1
 
 # Antispam configuration
-antispam.rules.attachments.interval=10
-antispam.rules.attachments.max=10
+antispam_rules_attachments_interval=10
+antispam_rules_attachments_max=10
 
-antispam.rules.burst.interval=10
-antispam.rules.burst.max=7
+antispam_rules_burst_interval=10
+antispam_rules_burst_max=7
 
-antispam.rules.chars.interval=5
-antispam.rules.chars.max=200
+antispam_rules_chars_interval=5
+antispam_rules_chars_max=200
 
-antispam.rules.discord_emojis.interval=10
-antispam.rules.discord_emojis.max=20
+antispam_rules_discord_emojis_interval=10
+antispam_rules_discord_emojis_max=20
 
-antispam.rules.duplicates.interval=10
-antispam.rules.duplicates.max=3
+antispam_rules_duplicates_interval=10
+antispam_rules_duplicates_max=3
 
-antispam.rules.links.interval=10
-antispam.rules.links.max=10
+antispam_rules_links_interval=10
+antispam_rules_links_max=10
 
-antispam.rules.mentions.interval=10
-antispam.rules.mentions.max=5
+antispam_rules_mentions_interval=10
+antispam_rules_mentions_max=5
 
-antispam.rules.newlines.interval=10
-antispam.rules.newlines.max=100
-antispam.rules.newlines.max_consecutive=10
+antispam_rules_newlines_interval=10
+antispam_rules_newlines_max=100
+antispam_rules_newlines_max_consecutive=10
 
-antispam.rules.role_mentions.interval=10
-antispam.rules.role_mentions.max=3
+antispam_rules_role_mentions_interval=10
+antispam_rules_role_mentions_max=3
 
 
-antispam.cache_size=100
-antispam.clean_offending=true
-antispam.ping_everyone=true
-antispam.punishment.remove_after=600
+antispam_cache_size=100
+antispam_clean_offending=true
+antispam_ping_everyone=true
+antispam_punishment_remove_after=600
 
 
 # Help channels configuration
-help_channels.enable=true
-help_channels.idle_minutes=30
-help_channels.deleted_idle_minutes=5
+help_channels_enable=true
+help_channels_idle_minutes=30
+help_channels_deleted_idle_minutes=5
 
 # Redirect output configuration
-redirect_output.delete_delay=15
-redirect_output.delete_invocation=true
+redirect_output_delete_delay=15
+redirect_output_delete_invocation=true
 
 # Duck pond configuration
-duckpond.threshold=7
+duckpond_threshold=7
 
 # Python news configuration
-python_news.mail_lists=
+python_news_mail_lists=
 
 # Voice gate configuration
-voice_gate.bot_message_delete_delay=10
-voice_gate.minimum_activity_blocks=3
-voice_gate.minimum_days_member=3
-voice_gate.minimum_messages=50
-voice_gate.voice_ping_delete_delay=60
+voice_gate_bot_message_delete_delay=10
+voice_gate_minimum_activity_blocks=3
+voice_gate_minimum_days_member=3
+voice_gate_minimum_messages=50
+voice_gate_voice_ping_delete_delay=60
 
 # Branding configuration
-branding.cycle_frequency=3
+branding_cycle_frequency=3
 
 # Video permisions configuration
-video_permission.default_permission_duration=5
+video_permission_default_permission_duration=5
 
 # Redis configuration
-redis.host="redis.default.svc.cluster.local"
-redis.port=6379
-redis.use_fakeredis=false  # If this is true, Bot will use fakeredis.aioredis
+redis_host="redis.default.svc.cluster.local"
+redis_port=6379
+redis_use_fakeredis=false  # If this is true, Bot will use fakeredis.aioredis
 
 # Cleaning configuration
-clean.message_limit=10000
+clean_message_limit=10000
 
 # Stats configuration
-stats.presence_update_timeout=30
-stats.statsd_host="graphite.default.svc.cluster.local"
+stats_presence_update_timeout=30
+stats_statsd_host="graphite.default.svc.cluster.local"
 
 # Cooldowns configuration
-cooldowns.tags=60
+cooldowns_tags=60
 
 # Metabase configuration
-metabase.base_url="http://metabase.default.svc.cluster.local"
-metabase.public_url="https://metabase.pythondiscord.com"
-metabase.max_session_age=20_160
+metabase_base_url="http://metabase.default.svc.cluster.local"
+metabase_public_url="https://metabase.pythondiscord.com"
+metabase_max_session_age=20_160
 
 # URLs configuration
 
-urls.snekbox_eval_api="http://snekbox.default.svc.cluster.local/eval"
-urls.snekbox_311_eval_api="http://snekbox-311.default.svc.cluster.local/eval"
+urls_snekbox_eval_api="http://snekbox.default.svc.cluster.local/eval"
+urls_snekbox_311_eval_api="http://snekbox-311.default.svc.cluster.local/eval"
 
 # Discord API
-urls.discord_api="https://discordapp.com/api/v7/"
+urls_discord_api="https://discordapp.com/api/v7/"
 
 # Misc endpoints
-urls.bot_avatar="https://raw.githubusercontent.com/python-discord/branding/main/logos/logo_circle/logo_circle.png"
-urls.github_bot_repo=https://github.com/python-discord/bot
+urls_bot_avatar="https://raw.githubusercontent.com/python-discord/branding/main/logos/logo_circle/logo_circle.png"
+urls_github_bot_repo=https://github.com/python-discord/bot
 
 # Site
-urls.site="pythondiscord.com"
-urls.site_schema="https://"
-urls.site_api="site.default.svc.cluster.local/api"
-urls.site_api_schema="http://"
+urls_site="pythondiscord.com"
+urls_site_schema="https://"
+urls_site_api="site.default.svc.cluster.local/api"
+urls_site_api_schema="http://"
 
-urls.connect_max_retries=3
-urls.connect_cooldown=5
+urls_connect_max_retries=3
+urls_connect_cooldown=5
 
 ##### << The bot shouldn't fail without these, but commands adding specific emojis won't work. >> #####
 ##### << You should at least set the trashcan. Set the incidents emojis if relevant. >> #####
@@ -451,119 +451,119 @@ urls.connect_cooldown=5
 
 
 # Emojis configuration
-emojis.badge_bug_hunter="<:bug_hunter_lvl1:743882896372269137>"
-emojis.badge_bug_hunter_level_2="<:bug_hunter_lvl2:743882896611344505>"
-emojis.badge_early_supporter="<:early_supporter:743882896909140058>"
-emojis.badge_hypesquad="<:hypesquad_events:743882896892362873>"
-emojis.badge_hypesquad_balance="<:hypesquad_balance:743882896460480625>"
-emojis.badge_hypesquad_bravery="<:hypesquad_bravery:743882896745693335>"
-emojis.badge_hypesquad_brilliance="<:hypesquad_brilliance:743882896938631248>"
-emojis.badge_partner="<:partner:748666453242413136>"
-emojis.badge_staff="<:discord_staff:743882896498098226>"
-emojis.badge_verified_bot_developer="<:verified_bot_dev:743882897299210310>"
-emojis.verified_bot="<:verified_bot:811645219220750347>"
-emojis.bot="<:bot:812712599464443914>"
-
-emojis.defcon_shutdown="<:defcondisabled:470326273952972810>"  # noqa: E704
-emojis.defcon_unshutdown="<:defconenabled:470326274213150730>"  # noqa: E704
-emojis.defcon_update="<:defconsettingsupdated:470326274082996224>"  # noqa: E704
-
-emojis.failmail="<:failmail:633660039931887616>"
-
-emojis.incident_actioned="<:incident_actioned:714221559279255583>"
-emojis.incident_investigating="<:incident_investigating:714224190928191551>"
-emojis.incident_unactioned="<:incident_unactioned:714223099645526026>"
-
-emojis.status_dnd="<:status_dnd:470326272082313216>"
-emojis.status_idle="<:status_idle:470326266625785866>"
-emojis.status_offline="<:status_offline:470326266537705472>"
-emojis.status_online="<:status_online:470326272351010816>"
-
-emojis.ducky_dave="<:ducky_dave:742058418692423772>"
-
-emojis.trashcan="<:trashcan:637136429717389331>"
-
-emojis.bullet="\u2022"
-emojis.check_mark="\u2705"
-emojis.cross_mark="\u274C"
-emojis.new="\U0001F195"
-emojis.pencil="\u270F"
-
-emojis.ok_hand=":ok_hand:"
+emojis_badge_bug_hunter="<:bug_hunter_lvl1:743882896372269137>"
+emojis_badge_bug_hunter_level_2="<:bug_hunter_lvl2:743882896611344505>"
+emojis_badge_early_supporter="<:early_supporter:743882896909140058>"
+emojis_badge_hypesquad="<:hypesquad_events:743882896892362873>"
+emojis_badge_hypesquad_balance="<:hypesquad_balance:743882896460480625>"
+emojis_badge_hypesquad_bravery="<:hypesquad_bravery:743882896745693335>"
+emojis_badge_hypesquad_brilliance="<:hypesquad_brilliance:743882896938631248>"
+emojis_badge_partner="<:partner:748666453242413136>"
+emojis_badge_staff="<:discord_staff:743882896498098226>"
+emojis_badge_verified_bot_developer="<:verified_bot_dev:743882897299210310>"
+emojis_verified_bot="<:verified_bot:811645219220750347>"
+emojis_bot="<:bot:812712599464443914>"
+
+emojis_defcon_shutdown="<:defcondisabled:470326273952972810>"  # noqa: E704
+emojis_defcon_unshutdown="<:defconenabled:470326274213150730>"  # noqa: E704
+emojis_defcon_update="<:defconsettingsupdated:470326274082996224>"  # noqa: E704
+
+emojis_failmail="<:failmail:633660039931887616>"
+
+emojis_incident_actioned="<:incident_actioned:714221559279255583>"
+emojis_incident_investigating="<:incident_investigating:714224190928191551>"
+emojis_incident_unactioned="<:incident_unactioned:714223099645526026>"
+
+emojis_status_dnd="<:status_dnd:470326272082313216>"
+emojis_status_idle="<:status_idle:470326266625785866>"
+emojis_status_offline="<:status_offline:470326266537705472>"
+emojis_status_online="<:status_online:470326272351010816>"
+
+emojis_ducky_dave="<:ducky_dave:742058418692423772>"
+
+emojis_trashcan="<:trashcan:637136429717389331>"
+
+emojis_bullet="\u2022"
+emojis_check_mark="\u2705"
+emojis_cross_mark="\u274C"
+emojis_new="\U0001F195"
+emojis_pencil="\u270F"
+
+emojis_ok_hand=":ok_hand:"
 
 # Icons configuration
 
-icons.crown_blurple="https://cdn.discordapp.com/emojis/469964153289965568.png"
-icons.crown_green="https://cdn.discordapp.com/emojis/469964154719961088.png"
-icons.crown_red="https://cdn.discordapp.com/emojis/469964154879344640.png"
+icons_crown_blurple="https://cdn.discordapp.com/emojis/469964153289965568.png"
+icons_crown_green="https://cdn.discordapp.com/emojis/469964154719961088.png"
+icons_crown_red="https://cdn.discordapp.com/emojis/469964154879344640.png"
 
-icons.defcon_denied="https://cdn.discordapp.com/emojis/472475292078964738.png"
-icons.defcon_shutdown="https://cdn.discordapp.com/emojis/470326273952972810.png"
-icons.defcon_unshutdown="https://cdn.discordapp.com/emojis/470326274213150730.png"
-icons.defcon_update="https://cdn.discordapp.com/emojis/472472638342561793.png"
+icons_defcon_denied="https://cdn.discordapp.com/emojis/472475292078964738.png"
+icons_defcon_shutdown="https://cdn.discordapp.com/emojis/470326273952972810.png"
+icons_defcon_unshutdown="https://cdn.discordapp.com/emojis/470326274213150730.png"
+icons_defcon_update="https://cdn.discordapp.com/emojis/472472638342561793.png"
 
-icons.filtering="https://cdn.discordapp.com/emojis/472472638594482195.png"
+icons_filtering="https://cdn.discordapp.com/emojis/472472638594482195.png"
 
-icons.green_checkmark="https://raw.githubusercontent.com/python-discord/branding/main/icons/checkmark/green-checkmark-dist.png"
-icons.green_questionmark="https://raw.githubusercontent.com/python-discord/branding/main/icons/checkmark/green-question-mark-dist.png"
+icons_green_checkmark="https://raw.githubusercontent.com/python-discord/branding/main/icons/checkmark/green-checkmark-dist.png"
+icons_green_questionmark="https://raw.githubusercontent.com/python-discord/branding/main/icons/checkmark/green-question-mark-dist.png"
 
-icons.guild_update="https://cdn.discordapp.com/emojis/469954765141442561.png"
+icons_guild_update="https://cdn.discordapp.com/emojis/469954765141442561.png"
 
-icons.hash_blurple="https://cdn.discordapp.com/emojis/469950142942806017.png"
-icons.hash_green="https://cdn.discordapp.com/emojis/469950144918585344.png"
-icons.hash_red="https://cdn.discordapp.com/emojis/469950145413251072.png"
+icons_hash_blurple="https://cdn.discordapp.com/emojis/469950142942806017.png"
+icons_hash_green="https://cdn.discordapp.com/emojis/469950144918585344.png"
+icons_hash_red="https://cdn.discordapp.com/emojis/469950145413251072.png"
 
-icons.message_bulk_delete="https://cdn.discordapp.com/emojis/469952898994929668.png"
-icons.message_delete="https://cdn.discordapp.com/emojis/472472641320648704.png"
-icons.message_edit="https://cdn.discordapp.com/emojis/472472638976163870.png"
+icons_message_bulk_delete="https://cdn.discordapp.com/emojis/469952898994929668.png"
+icons_message_delete="https://cdn.discordapp.com/emojis/472472641320648704.png"
+icons_message_edit="https://cdn.discordapp.com/emojis/472472638976163870.png"
 
-icons.pencil="https://cdn.discordapp.com/emojis/470326272401211415.png"
+icons_pencil="https://cdn.discordapp.com/emojis/470326272401211415.png"
 
-icons.questionmark="https://cdn.discordapp.com/emojis/512367613339369475.png"
+icons_questionmark="https://cdn.discordapp.com/emojis/512367613339369475.png"
 
-icons.remind_blurple="https://cdn.discordapp.com/emojis/477907609215827968.png"
-icons.remind_green="https://cdn.discordapp.com/emojis/477907607785570310.png"
-icons.remind_red="https://cdn.discordapp.com/emojis/477907608057937930.png"
+icons_remind_blurple="https://cdn.discordapp.com/emojis/477907609215827968.png"
+icons_remind_green="https://cdn.discordapp.com/emojis/477907607785570310.png"
+icons_remind_red="https://cdn.discordapp.com/emojis/477907608057937930.png"
 
-icons.sign_in="https://cdn.discordapp.com/emojis/469952898181234698.png"
-icons.sign_out="https://cdn.discordapp.com/emojis/469952898089091082.png"
+icons_sign_in="https://cdn.discordapp.com/emojis/469952898181234698.png"
+icons_sign_out="https://cdn.discordapp.com/emojis/469952898089091082.png"
 
-icons.superstarify="https://cdn.discordapp.com/emojis/636288153044516874.png"
-icons.unsuperstarify="https://cdn.discordapp.com/emojis/636288201258172446.png"
+icons_superstarify="https://cdn.discordapp.com/emojis/636288153044516874.png"
+icons_unsuperstarify="https://cdn.discordapp.com/emojis/636288201258172446.png"
 
-icons.token_removed="https://cdn.discordapp.com/emojis/470326273298792469.png"
+icons_token_removed="https://cdn.discordapp.com/emojis/470326273298792469.png"
 
-icons.user_ban="https://cdn.discordapp.com/emojis/469952898026045441.png"
-icons.user_mute="https://cdn.discordapp.com/emojis/472472640100106250.png"
-icons.user_unban="https://cdn.discordapp.com/emojis/469952898692808704.png"
-icons.user_unmute="https://cdn.discordapp.com/emojis/472472639206719508.png"
-icons.user_update="https://cdn.discordapp.com/emojis/469952898684551168.png"
-icons.user_verified="https://cdn.discordapp.com/emojis/470326274519334936.png"
-icons.user_warn="https://cdn.discordapp.com/emojis/470326274238447633.png"
+icons_user_ban="https://cdn.discordapp.com/emojis/469952898026045441.png"
+icons_user_mute="https://cdn.discordapp.com/emojis/472472640100106250.png"
+icons_user_unban="https://cdn.discordapp.com/emojis/469952898692808704.png"
+icons_user_unmute="https://cdn.discordapp.com/emojis/472472639206719508.png"
+icons_user_update="https://cdn.discordapp.com/emojis/469952898684551168.png"
+icons_user_verified="https://cdn.discordapp.com/emojis/470326274519334936.png"
+icons_user_warn="https://cdn.discordapp.com/emojis/470326274238447633.png"
 
-icons.voice_state_blue="https://cdn.discordapp.com/emojis/656899769662439456.png"
-icons.voice_state_green="https://cdn.discordapp.com/emojis/656899770094452754.png"
-icons.voice_state_red="https://cdn.discordapp.com/emojis/656899769905709076.png"
+icons_voice_state_blue="https://cdn.discordapp.com/emojis/656899769662439456.png"
+icons_voice_state_green="https://cdn.discordapp.com/emojis/656899770094452754.png"
+icons_voice_state_red="https://cdn.discordapp.com/emojis/656899769905709076.png"
 
 ##### << Optional - If you don't care about the filtering, help channel and py-news cogs, ignore the rest of this file >> #####
 
 # Filters configuration
-filters.filter_domains=true
-filters.filter_everyone_ping=true
-filters.filter_invites=true
-filters.filter_zalgo=false
-filters.watch_regex=true
-filters.watch_rich_embeds=true
+filters_filter_domains=true
+filters_filter_everyone_ping=true
+filters_filter_invites=true
+filters_filter_zalgo=false
+filters_watch_regex=true
+filters_watch_rich_embeds=true
 
 ### Notifications are not expected for "watchlist" type filters
 
-filters.notify_user_domains=false
-filters.notify_user_everyone_ping=true
-filters.notify_user_invites=true
-filters.notify_user_zalgo=false
+filters_notify_user_domains=false
+filters_notify_user_everyone_ping=true
+filters_notify_user_invites=true
+filters_notify_user_zalgo=false
 
-filters.offensive_msg_delete_days=7
-filters.ping_everyone=true
+filters_offensive_msg_delete_days=7
+filters_ping_everyone=true
 
   
   
@@ -573,17 +573,17 @@ filters.ping_everyone=true If you don't wish to use the provided `env.server` above, the main values that need overriding are **all** the ones prefixed with: -* `guild.` -* `categories.` -* `channels.` -* `roles.` -* `webhooks.` -* `emojis.` +* `guild_` +* `categories_` +* `channels_` +* `roles_` +* `webhooks_` +* `emojis_` Additionally: -* At this stage, set `redis.use_fakeredis` to `true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). -* Set `urls.site_schema` and `urls.site_api_schema` to `"http://"`. +* At this stage, set `redis_use_fakeredis` to `true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). +* Set `urls_site_schema` and `urls_site_api_schema` to `"http://"`. We understand this is tedious which is why we **recommend** using the [automatic configuration setup](#automatic-configuration) @@ -606,7 +606,7 @@ We understand this is tedious which is why we **recommend** using the [automatic ##### .env The second file you need to create is the one containing the environment variables, and needs to be named `.env`. -Inside, add the line `BOT.TOKEN=YourDiscordBotTokenHere`. See [here](../creating-bot-account) for help with obtaining the bot token. +Inside, add the line `BOT_TOKEN=YourDiscordBotTokenHere`. See [here](../creating-bot-account) for help with obtaining the bot token. **Note**: The `.env` is and should remain ignored by git, otherwise you risk pushing sensitive information. @@ -627,7 +627,7 @@ Once the previous steps are done, all that is left is to: 1. Create a new channel 2. Choose the `Forum` type 3. [Copy its ID](../obtaining-discord-ids#channel-id) -4. Add the following line to the `.env.server` file: `channels.python_help={newly_created_forum_channel_id}` +4. Add the following line to the `.env.server` file: `channels_python_help={newly_created_forum_channel_id}` ### Run it! @@ -656,10 +656,10 @@ You are now almost ready to run the Python bot. The simplest way to do so is wit In your `.env.server` file: -* Set `urls.site` to `"web:8000"`. +* Set `urls_site` to `"web:8000"`. * If you wish to work with snekbox set the following: - * `urls.snekbox_eval_api` to `"http://snekbox:8060/eval"` - * `urls.snekbox_311_eval_api` to `"http://snekbox-311:8060/eval"`. + * `urls_snekbox_eval_api` to `"http://snekbox:8060/eval"` + * `urls_snekbox_311_eval_api` to `"http://snekbox-311:8060/eval"`. Assuming you have Docker installed **and running**, enter the cloned repo in the command line and type `docker-compose up`. @@ -672,9 +672,9 @@ Your bot is now running, but this method makes debugging with an IDE a fairly in #### With the Bot Running Locally The advantage of this method is that you can run the bot's code in your preferred editor, with debugger and all, while keeping all the setup of the bot's various dependencies inside Docker. -* Append the following line to your `.env` file: `API_KEYS.SITE_API=badbot13m0n8f570f942013fc818f234916ca531`. -* In your `.env.server` file, set `urls.site` to `"localhost:8000"`. If you wish to keep using `web:8000`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. -* To work with snekbox, set `urls.snekbox_eval_api` to `"http://localhost:8060/eval"` and `urls.snekbox_311_eval_api` to `"http://localhost:8065/eval"` +* Append the following line to your `.env` file: `API_KEYS_SITE_API=badbot13m0n8f570f942013fc818f234916ca531`. +* In your `.env.server` file, set `urls_site` to `"localhost:8000"`. If you wish to keep using `web:8000`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. +* To work with snekbox, set `urls_snekbox_eval_api` to `"http://localhost:8060/eval"` and `urls_snekbox_311_eval_api` to `"http://localhost:8065/eval"` You will need to start the services separately, but if you got the previous section with Docker working, that's pretty simple: @@ -760,15 +760,15 @@ We are always open to more statistics so add as many as you can! --- ### Optional: Working with Redis -In [Configure the Bot](#envserver) you were asked to set `redis.use_fakeredis` to `true`. If you do not need to work on features that rely on Redis, this is enough. Fakeredis will give the illusion that features relying on Redis are saving information properly, but restarting the bot or the specific cog will wipe that information. +In [Configure the Bot](#envserver) you were asked to set `redis_use_fakeredis` to `true`. If you do not need to work on features that rely on Redis, this is enough. Fakeredis will give the illusion that features relying on Redis are saving information properly, but restarting the bot or the specific cog will wipe that information. If you are working on a feature that relies on Redis, you will need to enable Redis to make sure persistency is achieved for the feature across restarts. The first step towards that is going to `.env.server` and setting `redis.use_fakeredis` to `false`. #### Starting Redis in Docker (Recommended) -If you're using the Docker image provided in the project's Docker Compose, open your `.env.server` file. If you're running the bot in Docker, set `redis.host` to `redis`, and if you're running it on the host set it to `localhost`. Set `bot.redis.password` to `""`. +If you're using the Docker image provided in the project's Docker Compose, open your `.env.server` file. If you're running the bot in Docker, set `redis_host` to `redis`, and if you're running it on the host set it to `localhost`. Set `redis_password` to `""`. #### Starting Redis Using Other Methods -You can run your own instance of Redis, but in that case you will need to correctly set `redis.host` and `redis.port`, and the `redis.password` value in `constants.py` should not be overridden. Then, enter the `.env` file, and set `REDIS.PASSWORD` to whatever password you set. +You can run your own instance of Redis, but in that case you will need to correctly set `redis_host` and `redis_port`, and the `redis_password` value in `constants.py` should not be overridden. Then, enter the `.env` file, and set `REDIS_PASSWORD` to whatever password you set. --- @@ -806,17 +806,17 @@ The following is a list of all available environment variables used by the bot: | Variable | Required | Description | |----------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `BOT.TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | -| `GUILD.ID` | When using the bootstrapping script | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | -| `API_KEYS.SITE_API` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | -| `BOT.SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | -| `BOT.TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | +| `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | +| `GUILD_ID` | When using the bootstrapping script | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | +| `API_KEYS_SITE_API` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | +| `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | +| `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | | `DEBUG` | In production | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default. | -| `REDIS.PASSWORD` | When not using FakeRedis | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)). | +| `REDIS_PASSWORD` | When not using FakeRedis | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)). | | `USE_METRICITY` | When using Metricity | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default. | -| `API_KEYS.GITHUB` | When you wish to interact with GitHub | The API key to interact with GitHub, for example to download files for the branding manager. | -| `METABASE.USERNAME` | When you wish to interact with Metabase | The username for a Metabase admin account. | -| `METABASE.PASSWORD` | When you wish to interact with Metabase | The password for a Metabase admin account. | +| `API_KEYS_GITHUB` | When you wish to interact with GitHub | The API key to interact with GitHub, for example to download files for the branding manager. | +| `METABASE_USERNAME` | When you wish to interact with Metabase | The username for a Metabase admin account. | +| `METABASE_PASSWORD` | When you wish to interact with Metabase | The password for a Metabase admin account. | --- From b804ef7f47a87ee3a80a7471e3d60107f5bda8fd Mon Sep 17 00:00:00 2001 From: shtlrs Date: Wed, 8 Mar 2023 12:39:42 +0100 Subject: [PATCH 30/51] make GUILD_ID always required --- .../content/resources/guides/pydis-guides/contributing/bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 078815430..38f87c91b 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -807,7 +807,7 @@ The following is a list of all available environment variables used by the bot: | Variable | Required | Description | |----------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | -| `GUILD_ID` | When using the bootstrapping script | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | +| `GUILD_ID` | Always | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | | `API_KEYS_SITE_API` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | | `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | | `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | From 21ed6cdfbde922b4340e78ac1c55e3dbf4f6aa85 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Wed, 8 Mar 2023 12:48:14 +0100 Subject: [PATCH 31/51] clarify where redis values should be overriden --- .../content/resources/guides/pydis-guides/contributing/bot.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 38f87c91b..e8d09a093 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -768,7 +768,8 @@ If you are working on a feature that relies on Redis, you will need to enable Re If you're using the Docker image provided in the project's Docker Compose, open your `.env.server` file. If you're running the bot in Docker, set `redis_host` to `redis`, and if you're running it on the host set it to `localhost`. Set `redis_password` to `""`. #### Starting Redis Using Other Methods -You can run your own instance of Redis, but in that case you will need to correctly set `redis_host` and `redis_port`, and the `redis_password` value in `constants.py` should not be overridden. Then, enter the `.env` file, and set `REDIS_PASSWORD` to whatever password you set. +You can run your own instance of Redis, but in that case you will need to correctly set `redis_host` and `redis_port` in your `.env.server` file and the `REDIS_PASSWORD` in the `.env` file. +**Note**: The previously mentioned variables **SHOULD NOT** be overriden or changed in `constants.py` --- From 781450f8bb76bc7a302a4473f646b2b06a207054 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 9 Mar 2023 16:33:34 +0100 Subject: [PATCH 32/51] update url of site_api --- .../content/resources/guides/pydis-guides/contributing/bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index e8d09a093..df29e5422 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -673,7 +673,7 @@ Your bot is now running, but this method makes debugging with an IDE a fairly in The advantage of this method is that you can run the bot's code in your preferred editor, with debugger and all, while keeping all the setup of the bot's various dependencies inside Docker. * Append the following line to your `.env` file: `API_KEYS_SITE_API=badbot13m0n8f570f942013fc818f234916ca531`. -* In your `.env.server` file, set `urls_site` to `"localhost:8000"`. If you wish to keep using `web:8000`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. +* In your `.env.server` file, set `urls_site_api` to `"localhost:8000/api"`. If you wish to keep using `web:8000`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. * To work with snekbox, set `urls_snekbox_eval_api` to `"http://localhost:8060/eval"` and `urls_snekbox_311_eval_api` to `"http://localhost:8065/eval"` You will need to start the services separately, but if you got the previous section with Docker working, that's pretty simple: From 57c2cbdcd9b5a31b37a6b469f169b223c283919f Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 10 Mar 2023 10:23:55 +0100 Subject: [PATCH 33/51] apply Zig's suggestions --- .../guides/pydis-guides/contributing/bot.md | 81 ++++++++++--------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index df29e5422..da9e1be58 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -16,7 +16,7 @@ The Python bot is tightly coupled with the Python Discord server, so to have a f It's possible to set the bot to use a single channel for all cogs, but that will cause extreme spam and will be difficult to work with. You can start your own server and set up channels as you see fit, but for your convenience we have a template for a development server you can use: [https://discord.new/zmHtscpYN9E3](https://discord.new/zmHtscpYN9E3). -Keep in mind that this is not an exact mirror of the Python server, but a reduced version for testing purposes. +The server will only contain the channels that are needed by the bot. --- ### Set Up a Bot Account @@ -35,18 +35,20 @@ If your bot fails to start with a `PrivilegedIntentsRequired` exception, this in --- ### Configure the Bot -You now have both the bot's code and a server to run it on. It's time you to connect the two by changing the bot's configurations. +You now have both the bot's code and a server to run it on. It's time for you to connect the two by changing the bot's configurations. This can be done either automatically or manually, and we'll be detailing the steps for both. +**Note**: Skip this step if you would like to configure the bot manually, but that will require more work. + #### Automatic configuration -To make setup much easier, there is a file called `botstrap.py` that represents a script to bootstrap the configuration for you and help you get started immediately -without having to spend much time copying ids from your newly created server into your configuration file. +To make setup much easier, the script in `botstrap.py` bootstraps the configuration for you and helps you get started immediately, +without having to spend much time copying IDs from your newly created server into your configuration file. -**Note**: This phase can be skipped and done manually, but would require extra manual work. +**Note**: The script will also work on existing servers as long as the channel names are the same as the one in Python Discord. ##### 1. Script setup ##### 1.1. Environment variables -You will need to create a file called `.env` which will contain two required values for the script to work: `BOT_TOKEN` and `GUILD_ID` +You will need to create a file called `.env`, which will contain two required values: `BOT_TOKEN` and `GUILD_ID`. Inside, add the following two lines: @@ -54,37 +56,37 @@ Inside, add the following two lines: BOT_TOKEN=YourDiscordBotTokenHere GUILD_ID=YourDiscordTestServerIdHere ``` -See [here](../creating-bot-account) for help with obtaining the bot token and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's id +See [here](../creating-bot-account) for help with obtaining the bot token, and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's ID. **Note**: The `.env` is and should remain ignored by git, otherwise you risk pushing sensitive information. ##### 1.2 Setting up the script environment The bootstrapping script is a Python program so you will need a compatible Python version and the necessary dependencies installed, which are all detailed here: -1. Make sure you follow steps `1` and `2` [here](#setting-up-a-development-environment) -2. [Install the `config-bootstrap` dependency group](../installing-project-dependencies#installing-specific-dependency-groups). +1. Make sure you have [Python 3.10](https://www.python.org/downloads/) installed. It helps if it is your system's default Python version. +2. [Install Poetry](https://github.com/python-poetry/poetry#installation). +3. [Install the dependencies](../installing-project-dependencies). #### 2. Running the script Once the script setup phase is complete, all that is left is to run it. -To do this, you'll simply need to run the `configure` poetry task like this +To do this, you'll simply need to run the `configure` poetry task: ```shell $ poetry run task configure ``` -or, without poetry and from the root directory +Once the script has finished running, you'll notice the creation of a new file called [`.env.server`](#envserver) at your project's root directory. +This file will contain the extracted IDs from your server which are necessary for your bot to run. -```shell -python3 -m botstrap -``` +**Congratulations**, you have finished the configuration and can now [run your bot](#run-it). -Once the script has finished running, you'll notice the creation of a new file called [`.env.server`](#envserver) at your project's root directory. -This file will contain the extracted ids from your newly created server which are necessary for your bot to run. -**Congratulations**, you have finished the configuration & can now start [running your bot](#run-it) #### Manual configuration + +**Note**: Skip this part if you used the automatic configuration. + ##### .env.server All server configuration values are saved in a file called `.env.server`, which needs to be at the root directory of the cloned code. This file contains the various configurations we use to make the bot run on the Python Discord server, such as channel and role IDs, and the emojis it works with. @@ -96,8 +98,7 @@ otherwise you'll need to create it manually. If you decide to set the configuration values manually, you will **only** need to set the values for the channels, roles, categories, etc. that are used by the component you are developing. - -Let's take an example where we suppose we'll only be testing a feature that needs the `announcements` channel. +For example, if we're testing a feature that only needs the `announcements` channel: `constants.py` @@ -571,7 +572,7 @@ filters_ping_everyone=true
-If you don't wish to use the provided `env.server` above, the main values that need overriding are **all** the ones prefixed with: +If you wish to set all values in your `env.server` for your testing server, you need to set **all** the ones prefixed with: * `guild_` * `categories_` @@ -585,7 +586,7 @@ Additionally: * At this stage, set `redis_use_fakeredis` to `true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). * Set `urls_site_schema` and `urls_site_api_schema` to `"http://"`. -We understand this is tedious which is why we **recommend** using the [automatic configuration setup](#automatic-configuration) +We understand this is tedious which is why we **heavily recommend** using the [automatic configuration setup](#automatic-configuration)
-
-
- - If you wish to set all values in your `env.server` for your testing server, you need to set **all** the ones prefixed with: * `guild_` From e207147d0d58af2ef6f75586f837ee3c96b8b7a4 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 10 Mar 2023 22:50:49 +0100 Subject: [PATCH 41/51] define .env & .env.server then display their usage --- .../guides/pydis-guides/contributing/bot.md | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 60e5f9b14..3fbec0908 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -39,7 +39,23 @@ If your bot fails to start with a `PrivilegedIntentsRequired` exception, this in You now have both the bot's code and a server to run it on. It's time for you to connect the two by changing the bot's configurations. This can be done either automatically or manually, and we'll be detailing the steps for both. -**Note**: Skip this step if you would like to configure the bot manually, but that will require more work. +One thing to know is that the bot relies on precisely **two** configuration files to work + +#### .env.server +All server configuration values are saved in this file, which needs to be at the root directory of the cloned code. +This file contains the various configurations we use to make the bot run on the Python Discord server, such as channel and role IDs, and the emojis it works with. +It also contains configurations such as how long it takes for a help channel to time out, and how many messages a user needs to voice-verify. + +This file will be created for you automatically if you decide to go with [automatic configuration](#automatic-configuration), +otherwise a lot of it has to be done by hand which will be detailed in the [manual configuration](#manual-configuration) section. + +#### .env +This file will mostly contain sensitive information such as your `BOT_TOKEN` and your `REDIS_PASSWORD`, and other configurations related to external services that the bot might use, +such as: `USE_METRICITY`, etc. which are all not necessarily coupled to things that can be fetched from your server, with the only exception to `GUILD_ID`. + +**Notes**: +* Both `.env` and `.env.server` are and should remain ignored by git, otherwise you risk pushing sensitive information. +* Skip the following step if you would like to configure the bot manually, but that will require more work. #### Automatic configuration To make setup much easier, the script in `botstrap.py` bootstraps the configuration for you and helps you get started immediately, @@ -59,7 +75,7 @@ GUILD_ID=YourDiscordTestServerIdHere ``` See [here](../creating-bot-account) for help with obtaining the bot token, and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's ID. -**Note**: The `.env` is and should remain ignored by git, otherwise you risk pushing sensitive information. + ##### 1.2 Setting up the script environment The bootstrapping script is a Python program so you will need a compatible Python version and the necessary dependencies installed, which are all detailed here: @@ -83,20 +99,15 @@ This file will contain the extracted IDs from your server which are necessary fo **Congratulations**, you have finished the configuration and can now [run your bot](#run-it). - #### Manual configuration **Note**: Skip this part if you used the automatic configuration. ##### .env.server -All server configuration values are saved in a file called `.env.server`, which needs to be at the root directory of the cloned code. -This file contains the various configurations we use to make the bot run on the Python Discord server, such as channel and role IDs, and the emojis it works with. -It also contains configurations such as how long it takes for a help channel to time out, and how many messages a user needs to voice-verify. +Reading this means that you're ready for a bit of manual labour. +If for some reason you've missed the automatic server setup section, you can read about it [here](#automatic-configuration) -If you decided to use the bootstrapping script, you'll find that this file has already been created (which we recommend), -otherwise you'll need to create it manually. - -If you decide to set the configuration values manually, you will **only** need to set the values for the channels, roles, categories, etc. +To configure the bot manually, you will **only** need to set the values for the channels, roles, categories, etc. that are used by the component you are developing. For example, if we're testing a feature that only needs the `announcements` channel: @@ -120,9 +131,11 @@ class _Channels(EnvConfig): Channels = _Channels() ``` -`.env.server` file +`.env.server` file: ```text +# .env.server + channels_announcements=1077875228002234398 ``` @@ -181,8 +194,6 @@ We understand this is tedious which is why we **heavily recommend** using the [a The second file you need to create is the one containing the environment variables, and needs to be named `.env`. Inside, add the line `BOT_TOKEN=YourDiscordBotTokenHere`. See [here](../creating-bot-account) for help with obtaining the bot token. -**Note**: The `.env` is and should remain ignored by git, otherwise you risk pushing sensitive information. - --- From becd1d6357abb35963898e2f78e55225da2e64fc Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 10 Mar 2023 22:55:11 +0100 Subject: [PATCH 42/51] appease linter --- .../content/resources/guides/pydis-guides/contributing/bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 3fbec0908..ccf940466 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -53,7 +53,7 @@ otherwise a lot of it has to be done by hand which will be detailed in the [manu This file will mostly contain sensitive information such as your `BOT_TOKEN` and your `REDIS_PASSWORD`, and other configurations related to external services that the bot might use, such as: `USE_METRICITY`, etc. which are all not necessarily coupled to things that can be fetched from your server, with the only exception to `GUILD_ID`. -**Notes**: +**Notes**: * Both `.env` and `.env.server` are and should remain ignored by git, otherwise you risk pushing sensitive information. * Skip the following step if you would like to configure the bot manually, but that will require more work. From ab5f1d522455a4c2d0d0f080dd1ecc47a9c68ef2 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 11 Mar 2023 09:33:44 +0100 Subject: [PATCH 43/51] update site urls one last time --- .../resources/guides/pydis-guides/contributing/bot.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index ccf940466..18797ab5b 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -50,8 +50,8 @@ This file will be created for you automatically if you decide to go with [automa otherwise a lot of it has to be done by hand which will be detailed in the [manual configuration](#manual-configuration) section. #### .env -This file will mostly contain sensitive information such as your `BOT_TOKEN` and your `REDIS_PASSWORD`, and other configurations related to external services that the bot might use, -such as: `USE_METRICITY`, etc. which are all not necessarily coupled to things that can be fetched from your server, with the only exception to `GUILD_ID`. +This file will mostly contain sensitive information such as your `BOT_TOKEN` and your `REDIS_PASSWORD`. +It will also contain configurations related to external services the bot might use such as `USE_METRICITY`, which are unrelated your server, with the only exception being `GUILD_ID`. **Notes**: * Both `.env` and `.env.server` are and should remain ignored by git, otherwise you risk pushing sensitive information. @@ -240,7 +240,7 @@ Your bot is now running, but this method makes debugging with an IDE a fairly in The advantage of this method is that you can run the bot's code in your preferred editor, with debugger and all, while keeping all the setup of the bot's various dependencies inside Docker. * Append the following line to your `.env` file: `API_KEYS_SITE_API=badbot13m0n8f570f942013fc818f234916ca531`. -* In your `.env.server` file, set `urls_site` to `"localhost:8000"` and `urls_site_api` to `"localhost:8000/api"`. If you wish to keep using `web:8000/api` and `web:8000/api`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. +* In your `.env.server` file, set `urls_site` to `"localhost:8000"` and `urls_site_api` to `"localhost:8000/api"`. If you wish to keep using `web:8000` and `web:8000/api`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. * To work with snekbox, set `urls_snekbox_eval_api` to `"http://localhost:8060/eval"` and `urls_snekbox_311_eval_api` to `"http://localhost:8065/eval"` You will need to start the services separately, but if you got the previous section with Docker working, that's pretty simple: From 22a66ebe50f8e52d5108ea629a34415fdc20cb6b Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 11 Mar 2023 22:27:05 +0100 Subject: [PATCH 44/51] delete dependency group orphan guide --- .../installing-project-dependencies.md | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md index 9ad240344..26d6de300 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/installing-project-dependencies.md @@ -39,27 +39,3 @@ $ poetry run task precommit ![PyCharm Poetry Environment](/static/images/content/contributing/pycharm_poetry.png)
6. PyCharm will automatically install the packages required into a virtual environment.
![PyCharm Project Interpreter](/static/images/content/contributing/pycharm_poetry_success.png) - - -## Installing specific dependency groups - -In some cases, like when you'll be using the configuration bootstrapping script, you might need to install extra dependencies that are -not necessary for the bot project to function. -These dependencies are generally put in a separate optional group likewise: - -```text -[tool.poetry.group.group-name] -... -[tool.poetry.group.group-name.dependencies] -pytest = "^6.0.0" -pytest-mock = "*" -``` - -To install them, you simply need to run the following command ---- - -```shell -$ poetry install --only {{group-name}} -``` - ---- From 2ce0b6936e93271e1de7f772686fb5adff7bb770 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Mon, 13 Mar 2023 12:36:39 +0100 Subject: [PATCH 45/51] mention `BOT_PREFIX` in the appendix --- .../guides/pydis-guides/contributing/bot.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 18797ab5b..795bf58f1 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -51,9 +51,10 @@ otherwise a lot of it has to be done by hand which will be detailed in the [manu #### .env This file will mostly contain sensitive information such as your `BOT_TOKEN` and your `REDIS_PASSWORD`. -It will also contain configurations related to external services the bot might use such as `USE_METRICITY`, which are unrelated your server, with the only exception being `GUILD_ID`. +It will also contain configurations related to external services the bot might use such as `USE_METRICITY`, which are unrelated to your server, with the only exception being `GUILD_ID`. **Notes**: + * Both `.env` and `.env.server` are and should remain ignored by git, otherwise you risk pushing sensitive information. * Skip the following step if you would like to configure the bot manually, but that will require more work. @@ -391,19 +392,20 @@ If you find any bugs in the bot or would like to request a feature, feel free to ### Appendix: Full ENV File Options The following is a list of all available environment variables used by the bot: -| Variable | Required | Description | -|----------------------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | -| `GUILD_ID` | Always | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | -| `API_KEYS_SITE_API` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | -| `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | -| `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | -| `DEBUG` | In production | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default. | -| `REDIS_PASSWORD` | When not using FakeRedis | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)). | -| `USE_METRICITY` | When using Metricity | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default. | -| `API_KEYS_GITHUB` | When you wish to interact with GitHub | The API key to interact with GitHub, for example to download files for the branding manager. | -| `METABASE_USERNAME` | When you wish to interact with Metabase | The username for a Metabase admin account. | -| `METABASE_PASSWORD` | When you wish to interact with Metabase | The password for a Metabase admin account. | +| Variable | Required | Description | +|----------------------|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `BOT_TOKEN` | Always | Your Discord bot account's token (see [Set Up a Bot Account](#set-up-a-bot-account)). | +| `GUILD_ID` | Always | Your Discord test server's id (see [Set Up a Test Server](#set-up-a-test-server)). | +| `BOT_PREFIX` | When you wish to use a prefix different than "!" | Your Discord bot command's prefix. | +| `API_KEYS_SITE_API` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | +| `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | +| `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | +| `DEBUG` | In production | `true` or `false`, depending on whether to enable debug mode, affecting the behavior of certain features. `true` by default. | +| `REDIS_PASSWORD` | When not using FakeRedis | The password to connect to the Redis database (see [Optional: Working with Redis](#optional-working-with-redis)). | +| `USE_METRICITY` | When using Metricity | `true` or `false`, depending on whether to enable metrics collection using Metricity (see [Optional: Working with Metricity](#optional-working-with-metricity)). `false` by default. | +| `API_KEYS_GITHUB` | When you wish to interact with GitHub | The API key to interact with GitHub, for example to download files for the branding manager. | +| `METABASE_USERNAME` | When you wish to interact with Metabase | The username for a Metabase admin account. | +| `METABASE_PASSWORD` | When you wish to interact with Metabase | The password for a Metabase admin account. | --- From 204f7c10ba950ef3758b0eb1b855ae36631c6002 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Mon, 13 Mar 2023 13:18:39 +0100 Subject: [PATCH 46/51] add hyperlink to open an issue --- .../content/resources/guides/pydis-guides/contributing/bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 795bf58f1..04b78f1cf 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -385,7 +385,7 @@ If you want to run the bot locally, you can run `docker-compose up metricity` in ### Issues? If you have any issues with setting up the bot, come discuss it with us on the [#dev-contrib](https://discord.gg/2h3qBv8Xaa) channel on our server. -If you find any bugs in the bot or would like to request a feature, feel free to open an issue on the repository. +If you find any bugs in the bot or would like to request a feature, feel free to [open an issue](https://github.com/python-discord/bot/issues/new/choose) on the repository. --- From d502ec4296e364dcbec86e2ab79c8980d35149a1 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 1 Apr 2023 21:20:37 +0200 Subject: [PATCH 47/51] lose all references to site and replace with the suitable changes --- .../guides/pydis-guides/contributing/bot.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 04b78f1cf..6f2c7e744 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -170,7 +170,6 @@ If you wish to set all values in your `env.server` for your testing server, you Additionally: * At this stage, set `redis_use_fakeredis` to `true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). -* Set `urls_site_schema` and `urls_site_api_schema` to `"http://"`. We understand this is tedious which is why we **heavily recommend** using the [automatic configuration setup](#automatic-configuration) @@ -224,11 +223,12 @@ You are now almost ready to run the Python bot. The simplest way to do so is wit In your `.env.server` file: -* Set `urls_site` to `"web:8000"` and `urls_site_api` to `"web:8000/api"`. -* If you wish to work with snekbox set the following: +* If you wish to work with snekbox, set the following: * `urls_snekbox_eval_api` to `"http://snekbox:8060/eval"` * `urls_snekbox_311_eval_api` to `"http://snekbox-311:8060/eval"`. + + Assuming you have Docker installed **and running**, enter the cloned repo in the command line and type `docker-compose up`. If working with snekbox you can run `docker-compose --profile 3.10 up` to also start up a 3.10 snekbox container, in addition to the default 3.11 container! @@ -241,9 +241,10 @@ Your bot is now running, but this method makes debugging with an IDE a fairly in The advantage of this method is that you can run the bot's code in your preferred editor, with debugger and all, while keeping all the setup of the bot's various dependencies inside Docker. * Append the following line to your `.env` file: `API_KEYS_SITE_API=badbot13m0n8f570f942013fc818f234916ca531`. -* In your `.env.server` file, set `urls_site` to `"localhost:8000"` and `urls_site_api` to `"localhost:8000/api"`. If you wish to keep using `web:8000` and `web:8000/api`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. +* In your `.env.server` file, set `urls_site_api` to `"http://localhost:8000/api"`. If you wish to keep using `http://web:8000/api`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. * To work with snekbox, set `urls_snekbox_eval_api` to `"http://localhost:8060/eval"` and `urls_snekbox_311_eval_api` to `"http://localhost:8065/eval"` + You will need to start the services separately, but if you got the previous section with Docker working, that's pretty simple: * `docker-compose up web` to start the site container. This is required. @@ -328,6 +329,9 @@ We are always open to more statistics so add as many as you can! --- ### Optional: Working with the help forum + +**Note**: This is only required when you're not configuring the bot [automatically](#automatic-configuration) + If you will be working on a feature that includes the python help forum, you will need to use `Forum Channels`. Forum channels cannot be included in a template, which is why this needs to be done by hand for the time being. @@ -382,6 +386,12 @@ If you want to run the bot locally, you can run `docker-compose up metricity` in --- +### Optional: Working with bot moderation logs +To be able to view moderation-related logs published by the bot to site, you will need to set `urls_site_logs_view` to `http://localhost:8000/staff/bot/logs` in your `.env.server`. +This will work in both Docker and locally. + +--- + ### Issues? If you have any issues with setting up the bot, come discuss it with us on the [#dev-contrib](https://discord.gg/2h3qBv8Xaa) channel on our server. From 0aea52cc5f1e480424d0056c7825f914f7baaa71 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 1 Apr 2023 21:30:41 +0200 Subject: [PATCH 48/51] apply wookie's suggestion to setting variables apply wookie's suggestion to setting variables --- .../guides/pydis-guides/contributing/bot.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 6f2c7e744..009354d22 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -169,7 +169,7 @@ If you wish to set all values in your `env.server` for your testing server, you Additionally: -* At this stage, set `redis_use_fakeredis` to `true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). +* At this stage, set `redis_use_fakeredis=true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). We understand this is tedious which is why we **heavily recommend** using the [automatic configuration setup](#automatic-configuration) @@ -241,8 +241,8 @@ Your bot is now running, but this method makes debugging with an IDE a fairly in The advantage of this method is that you can run the bot's code in your preferred editor, with debugger and all, while keeping all the setup of the bot's various dependencies inside Docker. * Append the following line to your `.env` file: `API_KEYS_SITE_API=badbot13m0n8f570f942013fc818f234916ca531`. -* In your `.env.server` file, set `urls_site_api` to `"http://localhost:8000/api"`. If you wish to keep using `http://web:8000/api`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. -* To work with snekbox, set `urls_snekbox_eval_api` to `"http://localhost:8060/eval"` and `urls_snekbox_311_eval_api` to `"http://localhost:8065/eval"` +* In your `.env.server` file, set `urls_site_api="http://localhost:8000/api"`. If you wish to keep using `http://web:8000/api`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set. +* To work with snekbox, set `urls_snekbox_eval_api="http://localhost:8060/eval"` and `urls_snekbox_311_eval_api="http://localhost:8065/eval"` You will need to start the services separately, but if you got the previous section with Docker working, that's pretty simple: @@ -351,12 +351,12 @@ Once the previous steps are done, all that is left is to: --- ### Optional: Working with Redis -In [Configure the Bot](#envserver) you were asked to set `redis_use_fakeredis` to `true`. If you do not need to work on features that rely on Redis, this is enough. Fakeredis will give the illusion that features relying on Redis are saving information properly, but restarting the bot or the specific cog will wipe that information. +In [Configure the Bot](#envserver) you were asked to set `redis_use_fakeredis=true`. If you do not need to work on features that rely on Redis, this is enough. Fakeredis will give the illusion that features relying on Redis are saving information properly, but restarting the bot or the specific cog will wipe that information. If you are working on a feature that relies on Redis, you will need to enable Redis to make sure persistency is achieved for the feature across restarts. The first step towards that is going to `.env.server` and setting `redis.use_fakeredis` to `false`. #### Starting Redis in Docker (Recommended) -If you're using the Docker image provided in the project's Docker Compose, open your `.env.server` file. If you're running the bot in Docker, set `redis_host` to `redis`, and if you're running it on the host set it to `localhost`. Set `redis_password` to `""`. +If you're using the Docker image provided in the project's Docker Compose, open your `.env.server` file. If you're running the bot in Docker, set `redis_host=redis`, and if you're running it on the host set it to `localhost`. Set `redis_password=""`. #### Starting Redis Using Other Methods You can run your own instance of Redis, but in that case you will need to correctly set `redis_host` and `redis_port` in your `.env.server` file and the `REDIS_PASSWORD` in the `.env` file. @@ -387,11 +387,16 @@ If you want to run the bot locally, you can run `docker-compose up metricity` in --- ### Optional: Working with bot moderation logs -To be able to view moderation-related logs published by the bot to site, you will need to set `urls_site_logs_view` to `http://localhost:8000/staff/bot/logs` in your `.env.server`. +To be able to view moderation-related logs published by the bot to site, you will need to set `urls_site_logs_view=http://localhost:8000/staff/bot/logs` in your `.env.server`. This will work in both Docker and locally. --- +### Optional: Changing your command prefix +If you would like a prefix other than the default `!`, set `BOT_PREFIX={{your_prefix}}` in `.env.server`. + +--- + ### Issues? If you have any issues with setting up the bot, come discuss it with us on the [#dev-contrib](https://discord.gg/2h3qBv8Xaa) channel on our server. From 493ab3c7381ba89f640b7b53d2d0d96bf8944dbf Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 1 Apr 2023 21:36:50 +0200 Subject: [PATCH 49/51] replace docker-compose with docker compose --- .../guides/pydis-guides/contributing/bot.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 009354d22..02564c0c8 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -16,6 +16,7 @@ The Python bot is tightly coupled with the Python Discord server, so to have a f It's possible to set the bot to use a single channel for all cogs, but that will cause extreme spam and will be difficult to work with. You can start your own server and set up channels as you see fit, but for your convenience we have a template for a development server you can use: [https://discord.new/zmHtscpYN9E3](https://discord.new/zmHtscpYN9E3). + Keep in mind that this is not an exact mirror of the Python server, but a reduced version for testing purposes. The channels there are mostly the ones needed by the bot. --- @@ -229,11 +230,11 @@ In your `.env.server` file: -Assuming you have Docker installed **and running**, enter the cloned repo in the command line and type `docker-compose up`. +Assuming you have Docker installed **and running**, enter the cloned repo in the command line and type `docker compose up`. -If working with snekbox you can run `docker-compose --profile 3.10 up` to also start up a 3.10 snekbox container, in addition to the default 3.11 container! +If working with snekbox you can run `docker compose --profile 3.10 up` to also start up a 3.10 snekbox container, in addition to the default 3.11 container! -After pulling the images and building the containers, your bot will start. Enter your server and type `!help` (or whatever prefix you chose instead of `!`). +After pulling the images and building the containers, your bot will start. Enter your server and type `!help` (or whatever prefix you [chose](#optional--changing-your-command-prefix) instead of `!`). Your bot is now running, but this method makes debugging with an IDE a fairly involved process. For additional running methods, continue reading the following sections. @@ -247,17 +248,17 @@ The advantage of this method is that you can run the bot's code in your preferre You will need to start the services separately, but if you got the previous section with Docker working, that's pretty simple: -* `docker-compose up web` to start the site container. This is required. -* `docker-compose up snekbox` to start the snekbox container. You only need this if you're planning on working on the snekbox cog. -* `docker-compose up snekbox-311` to start the snekbox 3.11 container. You only need this if you're planning on working on the snekbox cog. -* `docker-compose up redis` to start the Redis container. You only need this if you're not using fakeredis. For more info refer to [Working with Redis](#optional-working-with-redis). +* `docker compose up web` to start the site container. This is required. +* `docker compose up snekbox` to start the snekbox container. You only need this if you're planning on working on the snekbox cog. +* `docker compose up snekbox-311` to start the snekbox 3.11 container. You only need this if you're planning on working on the snekbox cog. +* `docker compose up redis` to start the Redis container. You only need this if you're not using fakeredis. For more info refer to [Working with Redis](#optional-working-with-redis). -You can start several services together: `docker-compose up web snekbox redis`. +You can start several services together: `docker compose up web snekbox redis`. ##### Setting Up a Development Environment The bot's code is Python code like any other. To run it locally, you will need the right version of Python with the necessary packages installed: -1. Make sure you have [Python 3.10](https://www.python.org/downloads/) installed. It helps if it is your system's default Python version. +1. Make sure you have [Python 3.11](https://www.python.org/downloads/) installed. It helps if it is your system's default Python version. 2. [Install Poetry](https://github.com/python-poetry/poetry#installation). 3. [Install the dependencies](../installing-project-dependencies). @@ -380,9 +381,9 @@ guild_id = replace_with_your_guild_id ``` To properly replicate production behavior, set the `staff_role_id`, `staff_categories`, and `ignore_categories` fields as well. -Now, `docker-compose up` will also start Metricity. +Now, `docker compose up` will also start Metricity. -If you want to run the bot locally, you can run `docker-compose up metricity` instead. +If you want to run the bot locally, you can run `docker compose up metricity` instead. --- From 4eedb972d4712082b9a2e381ea728a4fd59ed445 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 6 Apr 2023 23:59:53 +0200 Subject: [PATCH 50/51] remove redundant talk about .env --- .../guides/pydis-guides/contributing/bot.md | 42 ++++++++----------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 02564c0c8..00d70c0ed 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -40,7 +40,21 @@ If your bot fails to start with a `PrivilegedIntentsRequired` exception, this in You now have both the bot's code and a server to run it on. It's time for you to connect the two by changing the bot's configurations. This can be done either automatically or manually, and we'll be detailing the steps for both. -One thing to know is that the bot relies on precisely **two** configuration files to work +One thing to know is that the bot relies on precisely **two** configuration files to work. + + +#### .env +This file will mostly contain sensitive information such as your `BOT_TOKEN` and your `REDIS_PASSWORD`. +It will also contain configurations related to external services the bot might use such as `USE_METRICITY`, which are unrelated to your server, with the only exception being `GUILD_ID`. + +This file will **always** need to have `BOT_TOKEN` and `GUILD_ID` values set: + +```text +BOT_TOKEN=YourDiscordBotTokenHere +GUILD_ID=YourDiscordTestServerIdHere +``` +See [here](../creating-bot-account) for help with obtaining the bot token, and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's ID. + #### .env.server All server configuration values are saved in this file, which needs to be at the root directory of the cloned code. @@ -50,9 +64,6 @@ It also contains configurations such as how long it takes for a help channel to This file will be created for you automatically if you decide to go with [automatic configuration](#automatic-configuration), otherwise a lot of it has to be done by hand which will be detailed in the [manual configuration](#manual-configuration) section. -#### .env -This file will mostly contain sensitive information such as your `BOT_TOKEN` and your `REDIS_PASSWORD`. -It will also contain configurations related to external services the bot might use such as `USE_METRICITY`, which are unrelated to your server, with the only exception being `GUILD_ID`. **Notes**: @@ -66,19 +77,6 @@ without having to spend much time copying IDs from your server into your configu **Note**: The script will also work on existing servers as long as the channel names are the same as the one in Python Discord. ##### 1. Script setup -##### 1.1. Environment variables -You will need to create a file called `.env`, which will contain two required values: `BOT_TOKEN` and `GUILD_ID`. - -Inside, add the following two lines: - -```text -BOT_TOKEN=YourDiscordBotTokenHere -GUILD_ID=YourDiscordTestServerIdHere -``` -See [here](../creating-bot-account) for help with obtaining the bot token, and [here](../obtaining-discord-ids#guild-id) for help with obtaining the guild's ID. - - -##### 1.2 Setting up the script environment The bootstrapping script is a Python program so you will need a compatible Python version and the necessary dependencies installed, which are all detailed here: @@ -86,7 +84,7 @@ which are all detailed here: 2. [Install Poetry](https://github.com/python-poetry/poetry#installation). 3. [Install the dependencies](../installing-project-dependencies). -#### 2. Running the script +##### 2. Running the script Once the script setup phase is complete, all that is left is to run it. To do this, you'll simply need to run the `configure` poetry task: @@ -105,12 +103,11 @@ This file will contain the extracted IDs from your server which are necessary fo **Note**: Skip this part if you used the automatic configuration. -##### .env.server Reading this means that you're ready for a bit of manual labour. If for some reason you've missed the automatic server setup section, you can read about it [here](#automatic-configuration) To configure the bot manually, you will **only** need to set the values for the channels, roles, categories, etc. -that are used by the component you are developing. +that are used by the component you are developing inside the `.env.server` file. For example, if we're testing a feature that only needs the `announcements` channel: @@ -191,11 +188,6 @@ We understand this is tedious which is why we **heavily recommend** using the [a
-##### .env -The second file you need to create is the one containing the environment variables, and needs to be named `.env`. -Inside, add the line `BOT_TOKEN=YourDiscordBotTokenHere`. See [here](../creating-bot-account) for help with obtaining the bot token. - ---- ### Run it! From 42e7a8914be9cf8d4a10f17ebe4ace49c5046c25 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 7 Apr 2023 00:42:32 +0200 Subject: [PATCH 51/51] improve wording of a couple sections --- .../resources/guides/pydis-guides/contributing/bot.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 00d70c0ed..769ea8380 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -80,7 +80,7 @@ without having to spend much time copying IDs from your server into your configu The bootstrapping script is a Python program so you will need a compatible Python version and the necessary dependencies installed, which are all detailed here: -1. Make sure you have [Python 3.10](https://www.python.org/downloads/) installed. It helps if it is your system's default Python version. +1. Make sure you have [Python 3.11](https://www.python.org/downloads/) installed. It helps if it is your system's default Python version. 2. [Install Poetry](https://github.com/python-poetry/poetry#installation). 3. [Install the dependencies](../installing-project-dependencies). @@ -106,8 +106,8 @@ This file will contain the extracted IDs from your server which are necessary fo Reading this means that you're ready for a bit of manual labour. If for some reason you've missed the automatic server setup section, you can read about it [here](#automatic-configuration) -To configure the bot manually, you will **only** need to set the values for the channels, roles, categories, etc. -that are used by the component you are developing inside the `.env.server` file. +To configure the bot manually, you will **only** need to set inside the `.env.server` file the values for the channels, roles, categories, etc. +that are used by the component you are developing. For example, if we're testing a feature that only needs the `announcements` channel: @@ -165,9 +165,6 @@ If you wish to set all values in your `env.server` for your testing server, you * `webhooks_` * `emojis_` -Additionally: - -* At this stage, set `redis_use_fakeredis=true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). We understand this is tedious which is why we **heavily recommend** using the [automatic configuration setup](#automatic-configuration) @@ -220,6 +217,7 @@ In your `.env.server` file: * `urls_snekbox_eval_api` to `"http://snekbox:8060/eval"` * `urls_snekbox_311_eval_api` to `"http://snekbox-311:8060/eval"`. +* At this stage, set `redis_use_fakeredis` to `true`. If you're looking for instructions for working with Redis, see [Working with Redis](#optional-working-with-redis). Assuming you have Docker installed **and running**, enter the cloned repo in the command line and type `docker compose up`.