diff options
author | 2023-03-08 12:38:37 +0100 | |
---|---|---|
committer | 2023-03-08 12:39:23 +0100 | |
commit | 47308422a2a34d9fc66f0c5f7b423b12a775d919 (patch) | |
tree | 3ff9c81fd119461d5b667d0f8e4ae2bc25813370 /pydis_site/apps/content/resources | |
parent | appease linter (diff) |
update prefix to underscore: _
Diffstat (limited to 'pydis_site/apps/content/resources')
-rw-r--r-- | pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md | 616 |
1 files 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 272ba10a..07881543 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 </code> </pre> @@ -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. | --- |