diff options
| author | 2021-01-24 20:00:36 +0300 | |
|---|---|---|
| committer | 2021-01-24 20:00:36 +0300 | |
| commit | 05ab7f4e5dcd778ad80230cf16dbd0a71a220770 (patch) | |
| tree | 4465e8beb3450b6b640fba1a5c2a8b1b38fb5f02 | |
| parent | Reorganizes Config (diff) | |
Reorganizes constants.py
Mirrors the changes from config-default.yml to constants.py.
| -rw-r--r-- | bot/constants.py | 207 | ||||
| -rw-r--r-- | config-default.yml | 2 |
2 files changed, 111 insertions, 98 deletions
diff --git a/bot/constants.py b/bot/constants.py index be8d303f6..1905c8dfb 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -13,7 +13,7 @@ their default values from `config-default.yml`. import logging import os from collections.abc import Mapping -from enum import Enum, IntEnum +from enum import Enum from pathlib import Path from typing import Dict, List, Optional @@ -197,8 +197,8 @@ class Bot(metaclass=YAMLGetter): section = "bot" prefix: str - token: str sentry_dsn: Optional[str] + token: str class Redis(metaclass=YAMLGetter): @@ -206,29 +206,30 @@ class Redis(metaclass=YAMLGetter): subsection = "redis" host: str - port: int password: Optional[str] + port: int use_fakeredis: bool # If this is True, Bot will use fakeredis.aioredis class Filter(metaclass=YAMLGetter): section = "filter" - filter_zalgo: bool - filter_invites: bool filter_domains: bool filter_everyone_ping: bool + filter_invites: bool + filter_zalgo: bool watch_regex: bool watch_rich_embeds: bool # Notifications are not expected for "watchlist" type filters - notify_user_zalgo: bool - notify_user_invites: bool + notify_user_domains: bool notify_user_everyone_ping: bool + notify_user_invites: bool + notify_user_zalgo: bool - ping_everyone: bool offensive_msg_delete_days: int + ping_everyone: bool channel_whitelist: List[int] role_whitelist: List[int] @@ -245,10 +246,10 @@ class Colours(metaclass=YAMLGetter): section = "style" subsection = "colours" - soft_red: int + bright_green: int soft_green: int soft_orange: int - bright_green: int + soft_red: int orange: int pink: int purple: int @@ -265,41 +266,42 @@ class Emojis(metaclass=YAMLGetter): section = "style" subsection = "emojis" - defcon_disabled: str # noqa: E704 - defcon_enabled: str # noqa: E704 - defcon_updated: str # noqa: E704 - - status_online: str - status_offline: str - status_idle: str - status_dnd: str - - badge_staff: str - badge_partner: str - badge_hypesquad: str badge_bug_hunter: str + badge_bug_hunter_level_2: str + badge_early_supporter: str + badge_hypesquad: str + badge_hypesquad_balance: str badge_hypesquad_bravery: str badge_hypesquad_brilliance: str - badge_hypesquad_balance: str - badge_early_supporter: str - badge_bug_hunter_level_2: str + badge_partner: str + badge_staff: str badge_verified_bot_developer: str + defcon_disabled: str # noqa: E704 + defcon_enabled: str # noqa: E704 + defcon_updated: str # noqa: E704 + + failmail: str + incident_actioned: str - incident_unactioned: str incident_investigating: str + incident_unactioned: str + + status_dnd: str + status_idle: str + status_offline: str + status_online: str - failmail: str trashcan: str bullet: str + check_mark: str + cross_mark: str new: str pencil: str - cross_mark: str - check_mark: str - upvotes: str comments: str + upvotes: str user: str ok_hand: str @@ -320,6 +322,7 @@ class Icons(metaclass=YAMLGetter): filtering: str + green_checkmark: str guild_update: str hash_blurple: str @@ -330,38 +333,34 @@ class Icons(metaclass=YAMLGetter): message_delete: str message_edit: str + pencil: str + + questionmark: str + + remind_blurple: str + remind_green: str + remind_red: str + sign_in: str sign_out: str + superstarify: str + unsuperstarify: str + token_removed: str user_ban: str - user_unban: str - user_update: str - user_mute: str + user_unban: str user_unmute: str + user_update: str user_verified: str - user_warn: str - pencil: str - - remind_blurple: str - remind_green: str - remind_red: str - - questionmark: str - - superstarify: str - unsuperstarify: str - voice_state_blue: str voice_state_green: str voice_state_red: str - green_checkmark: str - class CleanMessages(metaclass=YAMLGetter): section = "bot" @@ -383,8 +382,8 @@ class Categories(metaclass=YAMLGetter): subsection = "categories" help_available: int - help_in_use: int help_dormant: int + help_in_use: int modmail: int voice: int @@ -393,55 +392,66 @@ class Channels(metaclass=YAMLGetter): section = "guild" subsection = "channels" - admin_announcements: int - admin_spam: int - admins: int - admins_voice: int announcements: int - attachment_log: int - big_brother_logs: int - bot_commands: int change_log: int - code_help_chat_1: int - code_help_chat_2: int - code_help_voice_1: int - code_help_voice_2: int - cooldown: int - defcon: int + mailing_lists: int + python_events: int + python_news: int + reddit: int + user_event_announcements: int + dev_contrib: int dev_core: int dev_log: int + + meta: int + python_discussion: int + + cooldown: int + + attachment_log: int dm_log: int + message_log: int + mod_log: int + user_log: int + voice_log: int + + off_topic_0: int + off_topic_1: int + off_topic_2: int + + bot_commands: int esoteric: int - general_voice: int + voice_gate: int + + admins: int + admin_spam: int + defcon: int helpers: int incidents: int incidents_archive: int - mailing_lists: int - message_log: int - meta: int + mods: int mod_alerts: int - mod_announcements: int - mod_log: int mod_spam: int - mods: int - off_topic_0: int - off_topic_1: int - off_topic_2: int organisation: int - python_discussion: int - python_events: int - python_news: int - reddit: int + + admin_announcements: int + mod_announcements: int staff_announcements: int + + admins_voice: int + code_help_voice_1: int + code_help_voice_2: int + general_voice: int staff_voice: int + + code_help_chat_1: int + code_help_chat_2: int staff_voice_chat: int - talent_pool: int - user_event_announcements: int - user_log: int voice_chat: int - voice_gate: int - voice_log: int + + big_brother_logs: int + talent_pool: int class Webhooks(metaclass=YAMLGetter): @@ -461,41 +471,44 @@ class Roles(metaclass=YAMLGetter): section = "guild" subsection = "roles" - admins: int announcements: int contributors: int - core_developers: int help_cooldown: int - helpers: int - jammers: int - moderators: int muted: int - owners: int partners: int python_community: int sprinters: int - team_leaders: int voice_verified: int + admins: int + core_developers: int + helpers: int + moderators: int + owners: int + + jammers: int + team_leaders: int + class Guild(metaclass=YAMLGetter): section = "guild" id: int invite: str # Discord invite, gets embedded in chat - moderation_channels: List[int] + moderation_categories: List[int] - moderation_roles: List[int] + moderation_channels: List[int] modlog_blacklist: List[int] reminder_whitelist: List[int] + moderation_roles: List[int] staff_roles: List[int] class Keys(metaclass=YAMLGetter): section = "keys" - site_api: Optional[str] github: Optional[str] + site_api: Optional[str] class URLs(metaclass=YAMLGetter): @@ -525,9 +538,9 @@ class URLs(metaclass=YAMLGetter): class Reddit(metaclass=YAMLGetter): section = "reddit" - subreddits: list client_id: Optional[str] secret: Optional[str] + subreddits: list class AntiSpam(metaclass=YAMLGetter): @@ -543,8 +556,8 @@ class AntiSpam(metaclass=YAMLGetter): class BigBrother(metaclass=YAMLGetter): section = 'big_brother' - log_delay: int header_message_limit: int + log_delay: int class CodeBlock(metaclass=YAMLGetter): @@ -560,8 +573,8 @@ class Free(metaclass=YAMLGetter): section = 'free' activity_timeout: int - cooldown_rate: int cooldown_per: float + cooldown_rate: int class HelpChannels(metaclass=YAMLGetter): @@ -584,25 +597,25 @@ class HelpChannels(metaclass=YAMLGetter): class RedirectOutput(metaclass=YAMLGetter): section = 'redirect_output' - delete_invocation: bool delete_delay: int + delete_invocation: bool class PythonNews(metaclass=YAMLGetter): section = 'python_news' - mail_lists: List[str] channel: int webhook: int + mail_lists: List[str] class VoiceGate(metaclass=YAMLGetter): section = "voice_gate" - minimum_days_member: int - minimum_messages: int bot_message_delete_delay: int minimum_activity_blocks: int + minimum_days_member: int + minimum_messages: int voice_ping_delete_delay: int diff --git a/config-default.yml b/config-default.yml index 26c365d5e..9ad9725e6 100644 --- a/config-default.yml +++ b/config-default.yml @@ -289,9 +289,9 @@ filter: filter_domains: true filter_everyone_ping: true filter_invites: true + filter_zalgo: false watch_regex: true watch_rich_embeds: true - filter_zalgo: false # Notify user on filter? # Notifications are not expected for "watchlist" type filters |