diff options
-rw-r--r-- | bot/constants.py | 521 |
1 files changed, 246 insertions, 275 deletions
diff --git a/bot/constants.py b/bot/constants.py index fa72de19f..922f41abd 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -8,23 +8,23 @@ By default, the values defined in the classes are used, these can be overridden import os from enum import Enum -from pydantic import BaseModel, BaseSettings, root_validator +from pydantic import BaseModel, root_validator +from pydantic_settings import BaseSettings -class EnvConfig(BaseSettings): +class EnvConfig( + BaseSettings, + env_file=(".env.server", ".env"), + env_file_encoding = "utf-8", + env_nested_delimiter = "__", + extra="ignore", +): """Our default configuration for models that should load from .env files.""" - class Config: - """Specify what .env files to load, and how to load them.""" - - env_file = ".env.server", ".env", - env_file_encoding = "utf-8" - env_nested_delimiter = "__" - class _Miscellaneous(EnvConfig): - debug = True - file_logs = False + debug: bool = True + file_logs: bool = False Miscellaneous = _Miscellaneous() @@ -34,192 +34,186 @@ FILE_LOGS = Miscellaneous.file_logs DEBUG_MODE = Miscellaneous.debug -class _Bot(EnvConfig): - EnvConfig.Config.env_prefix = "bot_" +class _Bot(EnvConfig, env_prefix="bot_"): - prefix = "!" - sentry_dsn = "" - token = "" - trace_loggers = "*" + prefix: str = "!" + sentry_dsn: str = "" + token: str + trace_loggers: str = "*" Bot = _Bot() -class _Channels(EnvConfig): - EnvConfig.Config.env_prefix = "channels_" +class _Channels(EnvConfig, env_prefix="channels_"): - announcements = 354619224620138496 - changelog = 748238795236704388 - mailing_lists = 704372456592506880 - python_events = 729674110270963822 - python_news = 704372456592506880 - reddit = 458224812528238616 + announcements: int = 354619224620138496 + changelog: int = 748238795236704388 + mailing_lists: int = 704372456592506880 + python_events: int = 729674110270963822 + python_news: int = 704372456592506880 + reddit: int = 458224812528238616 - dev_contrib = 635950537262759947 - dev_core = 411200599653351425 - dev_log = 622895325144940554 + dev_contrib: int = 635950537262759947 + dev_core: int = 411200599653351425 + dev_log: int = 622895325144940554 - meta = 429409067623251969 - python_general = 267624335836053506 + meta: int = 429409067623251969 + python_general: int = 267624335836053506 - python_help = 1035199133436354600 + python_help: int = 1035199133436354600 - attachment_log = 649243850006855680 - filter_log = 1014943924185473094 - message_log = 467752170159079424 - mod_log = 282638479504965634 - nomination_voting_archive = 833371042046148738 - user_log = 528976905546760203 - voice_log = 640292421988646961 + attachment_log: int = 649243850006855680 + filter_log: int = 1014943924185473094 + message_log: int = 467752170159079424 + mod_log: int = 282638479504965634 + nomination_voting_archive: int = 833371042046148738 + user_log: int = 528976905546760203 + voice_log: int = 640292421988646961 - off_topic_0 = 291284109232308226 - off_topic_1 = 463035241142026251 - off_topic_2 = 463035268514185226 + off_topic_0: int = 291284109232308226 + off_topic_1: int = 463035241142026251 + off_topic_2: int = 463035268514185226 - bot_commands = 267659945086812160 - discord_bots = 343944376055103488 - esoteric = 470884583684964352 - voice_gate = 764802555427029012 - code_jam_planning = 490217981872177157 + bot_commands: int = 267659945086812160 + discord_bots: int = 343944376055103488 + esoteric: int = 470884583684964352 + voice_gate: int = 764802555427029012 + code_jam_planning: int = 490217981872177157 # Staff - admins = 365960823622991872 - admin_spam = 563594791770914816 - defcon = 464469101889454091 - helpers = 385474242440986624 - incidents = 714214212200562749 - incidents_archive = 720668923636351037 - mod_alerts = 473092532147060736 - mod_meta = 775412552795947058 - mods = 305126844661760000 - nominations = 822920136150745168 - nomination_discussion = 798959130634747914 - nomination_voting = 822853512709931008 - organisation = 551789653284356126 + admins: int = 365960823622991872 + admin_spam: int = 563594791770914816 + defcon: int = 464469101889454091 + helpers: int = 385474242440986624 + incidents: int = 714214212200562749 + incidents_archive: int = 720668923636351037 + mod_alerts: int = 473092532147060736 + mod_meta: int = 775412552795947058 + mods: int = 305126844661760000 + nominations: int = 822920136150745168 + nomination_discussion: int = 798959130634747914 + nomination_voting: int = 822853512709931008 + organisation: int = 551789653284356126 # Staff announcement channels - admin_announcements = 749736155569848370 - mod_announcements = 372115205867700225 - staff_announcements = 464033278631084042 - staff_info = 396684402404622347 - staff_lounge = 464905259261755392 + admin_announcements: int = 749736155569848370 + mod_announcements: int = 372115205867700225 + staff_announcements: int = 464033278631084042 + staff_info: int = 396684402404622347 + staff_lounge: int = 464905259261755392 # Voice Channels - admins_voice = 500734494840717332 - code_help_voice_0 = 751592231726481530 - code_help_voice_1 = 764232549840846858 - general_voice_0 = 751591688538947646 - general_voice_1 = 799641437645701151 - staff_voice = 412375055910043655 + admins_voice: int = 500734494840717332 + code_help_voice_0: int = 751592231726481530 + code_help_voice_1: int = 764232549840846858 + general_voice_0: int = 751591688538947646 + general_voice_1: int = 799641437645701151 + staff_voice: int = 412375055910043655 - black_formatter = 846434317021741086 + black_formatter: int = 846434317021741086 # Voice Chat - code_help_chat_0 = 755154969761677312 - code_help_chat_1 = 766330079135268884 - staff_voice_chat = 541638762007101470 - voice_chat_0 = 412357430186344448 - voice_chat_1 = 799647045886541885 + code_help_chat_0: int = 755154969761677312 + code_help_chat_1: int = 766330079135268884 + staff_voice_chat: int = 541638762007101470 + voice_chat_0: int = 412357430186344448 + voice_chat_1: int = 799647045886541885 - big_brother = 468507907357409333 - duck_pond = 637820308341915648 - roles = 851270062434156586 + big_brother: int = 468507907357409333 + duck_pond: int = 637820308341915648 + roles: int = 851270062434156586 - rules = 693837295685730335 + rules: int = 693837295685730335 Channels = _Channels() -class _Roles(EnvConfig): - - EnvConfig.Config.env_prefix = "roles_" +class _Roles(EnvConfig, env_prefix="roles_"): # Self-assignable roles, see the Subscribe cog - advent_of_code = 518565788744024082 - announcements = 463658397560995840 - lovefest = 542431903886606399 - pyweek_announcements = 897568414044938310 - revival_of_code = 988801794668908655 - legacy_help_channels_access = 1074780483776417964 - - contributors = 295488872404484098 - help_cooldown = 699189276025421825 - partners = 323426753857191936 - python_community = 458226413825294336 - voice_verified = 764802720779337729 + advent_of_code: int = 518565788744024082 + announcements: int = 463658397560995840 + lovefest: int = 542431903886606399 + pyweek_announcements: int = 897568414044938310 + revival_of_code: int = 988801794668908655 + legacy_help_channels_access: int = 1074780483776417964 + + contributors: int = 295488872404484098 + help_cooldown: int = 699189276025421825 + partners: int = 323426753857191936 + python_community: int = 458226413825294336 + voice_verified: int = 764802720779337729 # Streaming - video = 764245844798079016 + video: int = 764245844798079016 # Staff - admins = 267628507062992896 - core_developers = 587606783669829632 - code_jam_event_team = 787816728474288181 - devops = 409416496733880320 - domain_leads = 807415650778742785 - events_lead = 778361735739998228 - helpers = 267630620367257601 - moderators = 831776746206265384 - mod_team = 267629731250176001 - owners = 267627879762755584 - project_leads = 815701647526330398 + admins: int = 267628507062992896 + core_developers: int = 587606783669829632 + code_jam_event_team: int = 787816728474288181 + devops: int = 409416496733880320 + domain_leads: int = 807415650778742785 + events_lead: int = 778361735739998228 + helpers: int = 267630620367257601 + moderators: int = 831776746206265384 + mod_team: int = 267629731250176001 + owners: int = 267627879762755584 + project_leads: int = 815701647526330398 # Code Jam - jammers = 737249140966162473 + jammers: int = 737249140966162473 # Patreon - patreon_tier_1 = 505040943800516611 - patreon_tier_2 = 743399725914390631 - patreon_tier_3 = 743400204367036520 + patreon_tier_1: int = 505040943800516611 + patreon_tier_2: int = 743399725914390631 + patreon_tier_3: int = 743400204367036520 Roles = _Roles() -class _Categories(EnvConfig): - EnvConfig.Config.env_prefix = "categories_" +class _Categories(EnvConfig, env_prefix="categories_"): - logs = 468520609152892958 - moderators = 749736277464842262 - modmail = 714494672835444826 - appeals = 890331800025563216 - appeals_2 = 895417395261341766 - voice = 356013253765234688 + logs: int = 468520609152892958 + moderators: int = 749736277464842262 + modmail: int = 714494672835444826 + appeals: int = 890331800025563216 + appeals_2: int = 895417395261341766 + voice: int = 356013253765234688 # 2021 Summer Code Jam - summer_code_jam = 861692638540857384 - python_help_system = 691405807388196926 + summer_code_jam: int = 861692638540857384 + python_help_system: int = 691405807388196926 Categories = _Categories() -class _Guild(EnvConfig): - EnvConfig.Config.env_prefix = "guild_" +class _Guild(EnvConfig, env_prefix="guild_"): - id = 267624335836053506 - invite = "https://discord.gg/python" + id: int = 267624335836053506 + invite: str = "https://discord.gg/python" - moderation_categories = [ + moderation_categories: tuple[int, ...] = ( Categories.moderators, Categories.modmail, Categories.logs, Categories.appeals, Categories.appeals_2 - ] - moderation_channels = [Channels.admins, Channels.admin_spam, Channels.mods] - modlog_blacklist = [ + ) + moderation_channels: tuple[int, ...] = (Channels.admins, Channels.admin_spam, Channels.mods) + modlog_blacklist: tuple[int, ...] = ( Channels.attachment_log, Channels.message_log, Channels.mod_log, Channels.staff_voice, Channels.filter_log - ] - reminder_whitelist = [Channels.bot_commands, Channels.dev_contrib, Channels.black_formatter] - moderation_roles = [Roles.admins, Roles.mod_team, Roles.moderators, Roles.owners] - staff_roles = [Roles.admins, Roles.helpers, Roles.mod_team, Roles.owners] + ) + reminder_whitelist: tuple[int, ...] = (Channels.bot_commands, Channels.dev_contrib, Channels.black_formatter) + moderation_roles: tuple[int, ...] = (Roles.admins, Roles.mod_team, Roles.moderators, Roles.owners) + staff_roles: tuple[int, ...] = (Roles.admins, Roles.helpers, Roles.mod_team, Roles.owners) Guild = _Guild() @@ -268,8 +262,7 @@ class Webhook(BaseModel): channel: int -class _Webhooks(EnvConfig): - EnvConfig.Config.env_prefix = "webhooks_" +class _Webhooks(EnvConfig, env_prefix="webhooks_"): big_brother: Webhook = Webhook(id=569133704568373283, channel=Channels.big_brother) dev_log: Webhook = Webhook(id=680501655111729222, channel=Channels.dev_log) @@ -282,44 +275,41 @@ class _Webhooks(EnvConfig): Webhooks = _Webhooks() -class _BigBrother(EnvConfig): - EnvConfig.Config.env_prefix = "big_brother_" +class _BigBrother(EnvConfig, env_prefix="big_brother_"): - header_message_limit = 15 - log_delay = 15 + header_message_limit: int = 15 + log_delay: int = 15 BigBrother = _BigBrother() -class _CodeBlock(EnvConfig): - EnvConfig.Config.env_prefix = "code_block_" +class _CodeBlock(EnvConfig, env_prefix="code_block_"): # The channels in which code blocks will be detected. They are not subject to a cooldown. - channel_whitelist: list[int] = [Channels.bot_commands] + channel_whitelist: tuple[int, ...] = (Channels.bot_commands,) # The channels which will be affected by a cooldown. These channels are also whitelisted. - cooldown_channels: list[int] = [Channels.python_general] + cooldown_channels: tuple[int, ...] = (Channels.python_general,) - cooldown_seconds = 300 - minimum_lines = 4 + cooldown_seconds: int = 300 + minimum_lines: int = 4 CodeBlock = _CodeBlock() -class _Colours(EnvConfig): - EnvConfig.Config.env_prefix = "colours_" +class _Colours(EnvConfig, env_prefix="colours_"): - blue = 0x3775a8 - bright_green = 0x01d277 - orange = 0xe67e22 - pink = 0xcf84e0 - purple = 0xb734eb - soft_green = 0x68c290 - soft_orange = 0xf9cb54 - soft_red = 0xcd6d6d - white = 0xfffffe - yellow = 0xffd241 + blue: int = 0x3775a8 + bright_green: int = 0x01d277 + orange: int = 0xe67e22 + pink: int = 0xcf84e0 + purple: int = 0xb734eb + soft_green: int = 0x68c290 + soft_orange: int = 0xf9cb54 + soft_red: int = 0xcd6d6d + white: int = 0xfffffe + yellow: int = 0xffd241 @root_validator(pre=True) def parse_hex_values(cls, values: dict) -> dict: # noqa: N805 @@ -332,35 +322,32 @@ class _Colours(EnvConfig): Colours = _Colours() -class _HelpChannels(EnvConfig): - EnvConfig.Config.env_prefix = "help_channels_" +class _HelpChannels(EnvConfig, env_prefix="help_channels_"): - enable = True - idle_minutes = 60 - deleted_idle_minutes = 5 + enable: bool = True + idle_minutes: int = 60 + deleted_idle_minutes: int = 5 # Roles which are allowed to use the command which makes channels dormant - cmd_whitelist = Guild.moderation_roles + cmd_whitelist: tuple[int, ...] = Guild.moderation_roles HelpChannels = _HelpChannels() -class _RedirectOutput(EnvConfig): - EnvConfig.Config.env_prefix = "redirect_output_" +class _RedirectOutput(EnvConfig, env_prefix="redirect_output_"): - delete_delay = 15 - delete_invocation = True + delete_delay: int = 15 + delete_invocation: bool = True RedirectOutput = _RedirectOutput() -class _DuckPond(EnvConfig): - EnvConfig.Config.env_prefix = "duck_pond_" +class _DuckPond(EnvConfig, env_prefix="duck_pond_"): - threshold = 7 + threshold: int = 7 - channel_blacklist: list[int] = [ + channel_blacklist: tuple[int, ...] = ( Channels.announcements, Channels.python_news, Channels.python_events, @@ -371,126 +358,114 @@ class _DuckPond(EnvConfig): Channels.staff_announcements, Channels.mod_announcements, Channels.admin_announcements, - Channels.staff_info - ] + Channels.staff_info, + ) DuckPond = _DuckPond() -class _PythonNews(EnvConfig): - EnvConfig.Config.env_prefix = "python_news_" +class _PythonNews(EnvConfig, env_prefix="python_news_"): channel: int = Webhooks.python_news.channel webhook: int = Webhooks.python_news.id - mail_lists = ["python-ideas", "python-announce-list", "pypi-announce", "python-dev"] + mail_lists: tuple[str, ...] = ("python-ideas", "python-announce-list", "pypi-announce", "python-dev") PythonNews = _PythonNews() -class _VoiceGate(EnvConfig): - EnvConfig.Config.env_prefix = "voice_gate_" +class _VoiceGate(EnvConfig, env_prefix="voice_gate_"): - bot_message_delete_delay = 10 - minimum_activity_blocks = 3 - minimum_days_member = 3 - minimum_messages = 50 - voice_ping_delete_delay = 60 + bot_message_delete_delay: int = 10 + minimum_activity_blocks: int = 3 + minimum_days_member: int = 3 + minimum_messages: int = 50 + voice_ping_delete_delay: int = 60 VoiceGate = _VoiceGate() -class _Branding(EnvConfig): - EnvConfig.Config.env_prefix = "branding_" +class _Branding(EnvConfig, env_prefix="branding_"): - cycle_frequency = 3 + cycle_frequency: int = 3 Branding = _Branding() -class _VideoPermission(EnvConfig): - EnvConfig.Config.env_prefix = "video_permission_" +class _VideoPermission(EnvConfig, env_prefix="video_permission_"): - default_permission_duration = 5 + default_permission_duration: int = 5 VideoPermission = _VideoPermission() -class _Redis(EnvConfig): - EnvConfig.Config.env_prefix = "redis_" +class _Redis(EnvConfig, env_prefix="redis_"): - host = "redis.default.svc.cluster.local" - password = "" - port = 6379 - use_fakeredis = False # If this is True, Bot will use fakeredis.aioredis + host: str = "redis.default.svc.cluster.local" + password: str = "" + port: int = 6379 + use_fakeredis: bool = False # If this is True, Bot will use fakeredis.aioredis Redis = _Redis() -class _CleanMessages(EnvConfig): - EnvConfig.Config.env_prefix = "clean_" +class _CleanMessages(EnvConfig, env_prefix="clean_"): - message_limit = 10_000 + message_limit: int = 10_000 CleanMessages = _CleanMessages() -class _Stats(EnvConfig): - EnvConfig.Config.env_prefix = "stats_" +class _Stats(EnvConfig, env_prefix="stats_"): - presence_update_timeout = 30 - statsd_host = "graphite.default.svc.cluster.local" + presence_update_timeout: int = 30 + statsd_host: str = "graphite.default.svc.cluster.local" Stats = _Stats() -class _Cooldowns(EnvConfig): - EnvConfig.Config.env_prefix = "cooldowns_" +class _Cooldowns(EnvConfig, env_prefix="cooldowns_"): - tags = 60 + tags: int = 60 Cooldowns = _Cooldowns() -class _Metabase(EnvConfig): - EnvConfig.Config.env_prefix = "metabase_" +class _Metabase(EnvConfig, env_prefix="metabase_"): - username = "" - password = "" - base_url = "http://metabase.default.svc.cluster.local" - public_url = "https://metabase.pythondiscord.com" - max_session_age = 20_160 + username: str = "" + password: str = "" + base_url: str = "http://metabase.default.svc.cluster.local" + public_url: str = "https://metabase.pythondiscord.com" + max_session_age: int = 20_160 Metabase = _Metabase() -class _BaseURLs(EnvConfig): - EnvConfig.Config.env_prefix = "urls_" +class _BaseURLs(EnvConfig, env_prefix="urls_"): # Snekbox endpoints - snekbox_eval_api = "http://snekbox.default.svc.cluster.local/eval" + snekbox_eval_api: str = "http://snekbox.default.svc.cluster.local/eval" # Discord API - discord_api = "https://discordapp.com/api/v7/" + discord_api: str = "https://discordapp.com/api/v7/" # Misc endpoints - bot_avatar = "https://raw.githubusercontent.com/python-discord/branding/main/logos/logo_circle/logo_circle.png" - - github_bot_repo = "https://github.com/python-discord/bot" + bot_avatar: str = "https://raw.githubusercontent.com/python-discord/branding/main/logos/logo_circle/logo_circle.png" + github_bot_repo: str = "https://github.com/python-discord/bot" # Site - site_api = "http://site.default.svc.cluster.local/api" - - paste_url = "https://paste.pythondiscord.com" + site_api: str = "http://site.default.svc.cluster.local/api" + paste_url: str = "https://paste.pythondiscord.com" BaseURLs = _BaseURLs() @@ -502,8 +477,8 @@ class _URLs(_BaseURLs): discord_invite_api: str = "".join([BaseURLs.discord_api, "invites"]) # Base site vars - connect_max_retries = 3 - connect_cooldown = 5 + connect_max_retries: int = 3 + connect_cooldown: int = 5 site_logs_view: str = "https://pythondiscord.com/staff/bot/logs" @@ -511,59 +486,57 @@ class _URLs(_BaseURLs): URLs = _URLs() -class _Emojis(EnvConfig): - EnvConfig.Config.env_prefix = "emojis_" +class _Emojis(EnvConfig, env_prefix="emojis_"): - badge_bug_hunter = "<:bug_hunter_lvl1:743882896372269137>" - badge_bug_hunter_level_2 = "<:bug_hunter_lvl2:743882896611344505>" - badge_early_supporter = "<:early_supporter:743882896909140058>" - badge_hypesquad = "<:hypesquad_events:743882896892362873>" - badge_hypesquad_balance = "<:hypesquad_balance:743882896460480625>" - badge_hypesquad_bravery = "<:hypesquad_bravery:743882896745693335>" - badge_hypesquad_brilliance = "<:hypesquad_brilliance:743882896938631248>" - badge_partner = "<:partner:748666453242413136>" - badge_staff = "<:discord_staff:743882896498098226>" - badge_verified_bot_developer = "<:verified_bot_dev:743882897299210310>" - badge_discord_certified_moderator = "<:discord_certified_moderator:1114130029547364434>" - badge_bot_http_interactions = "<:bot_http_interactions:1114130379754975283>" - badge_active_developer = "<:active_developer:1114130031036338176>" - verified_bot = "<:verified_bot:811645219220750347>" - bot = "<:bot:812712599464443914>" + badge_bug_hunter: str = "<:bug_hunter_lvl1:743882896372269137>" + badge_bug_hunter_level_2: str = "<:bug_hunter_lvl2:743882896611344505>" + badge_early_supporter: str = "<:early_supporter:743882896909140058>" + badge_hypesquad: str = "<:hypesquad_events:743882896892362873>" + badge_hypesquad_balance: str = "<:hypesquad_balance:743882896460480625>" + badge_hypesquad_bravery: str = "<:hypesquad_bravery:743882896745693335>" + badge_hypesquad_brilliance: str = "<:hypesquad_brilliance:743882896938631248>" + badge_partner: str = "<:partner:748666453242413136>" + badge_staff: str = "<:discord_staff:743882896498098226>" + badge_verified_bot_developer: str = "<:verified_bot_dev:743882897299210310>" + badge_discord_certified_moderator: str = "<:discord_certified_moderator:1114130029547364434>" + badge_bot_http_interactions: str = "<:bot_http_interactions:1114130379754975283>" + badge_active_developer: str = "<:active_developer:1114130031036338176>" + verified_bot: str = "<:verified_bot:811645219220750347>" + bot: str = "<:bot:812712599464443914>" - defcon_shutdown = "<:defcondisabled:470326273952972810>" - defcon_unshutdown = "<:defconenabled:470326274213150730>" - defcon_update = "<:defconsettingsupdated:470326274082996224>" + defcon_shutdown: str = "<:defcondisabled:470326273952972810>" + defcon_unshutdown: str = "<:defconenabled:470326274213150730>" + defcon_update: str = "<:defconsettingsupdated:470326274082996224>" - failmail = "<:failmail:633660039931887616>" - failed_file = "<:failed_file:1073298441968562226>" + failmail: str = "<:failmail:633660039931887616>" + failed_file: str = "<:failed_file:1073298441968562226>" - incident_actioned = "<:incident_actioned:714221559279255583>" - incident_investigating = "<:incident_investigating:714224190928191551>" - incident_unactioned = "<:incident_unactioned:714223099645526026>" + incident_actioned: str = "<:incident_actioned:714221559279255583>" + incident_investigating: str = "<:incident_investigating:714224190928191551>" + incident_unactioned: str = "<:incident_unactioned:714223099645526026>" - status_dnd = "<:status_dnd:470326272082313216>" - status_idle = "<:status_idle:470326266625785866>" - status_offline = "<:status_offline:470326266537705472>" - status_online = "<:status_online:470326272351010816>" + status_dnd: str = "<:status_dnd:470326272082313216>" + status_idle: str = "<:status_idle:470326266625785866>" + status_offline: str = "<:status_offline:470326266537705472>" + status_online: str = "<:status_online:470326272351010816>" - ducky_dave = "<:ducky_dave:742058418692423772>" + ducky_dave: str = "<:ducky_dave:742058418692423772>" - trashcan = "<:trashcan:637136429717389331>" + trashcan: str = "<:trashcan:637136429717389331>" - bullet = "\u2022" - check_mark = "\u2705" - cross_mark = "\u274C" - new = "\U0001F195" - pencil = "\u270F" + bullet: str = "\u2022" + check_mark: str = "\u2705" + cross_mark: str = "\u274C" + new: str = "\U0001F195" + pencil: str = "\u270F" - ok_hand = ":ok_hand:" + ok_hand: str = ":ok_hand:" Emojis = _Emojis() -class _Icons(EnvConfig): - EnvConfig.Config.env_prefix = "icons_" +class _Icons(EnvConfig, env_prefix="icons_"): crown_blurple = "https://cdn.discordapp.com/emojis/469964153289965568.png" crown_green = "https://cdn.discordapp.com/emojis/469964154719961088.png" @@ -620,12 +593,10 @@ class _Icons(EnvConfig): Icons = _Icons() -class _Keys(EnvConfig): - - EnvConfig.Config.env_prefix = "api_keys_" +class _Keys(EnvConfig, env_prefix="api_keys_"): - github = "" - site_api = "" + github: str = "" + site_api: str = "" Keys = _Keys() @@ -637,7 +608,7 @@ PROJECT_ROOT = os.path.abspath(os.path.join(BOT_DIR, os.pardir)) # Default role combinations MODERATION_ROLES = Guild.moderation_roles STAFF_ROLES = Guild.staff_roles -STAFF_PARTNERS_COMMUNITY_ROLES = STAFF_ROLES + [Roles.partners, Roles.python_community] +STAFF_PARTNERS_COMMUNITY_ROLES = STAFF_ROLES + (Roles.partners, Roles.python_community) # Channel combinations MODERATION_CHANNELS = Guild.moderation_channels @@ -650,7 +621,7 @@ GIT_SHA = os.environ.get("GIT_SHA", "development") # Bot replies -NEGATIVE_REPLIES = [ +NEGATIVE_REPLIES = ( "Noooooo!!", "Nope.", "I'm sorry Dave, I'm afraid I can't do that.", @@ -668,9 +639,9 @@ NEGATIVE_REPLIES = [ "NEGATORY.", "Nuh-uh.", "Not in my house!", -] +) -POSITIVE_REPLIES = [ +POSITIVE_REPLIES = ( "Yep.", "Absolutely!", "Can do!", @@ -688,9 +659,9 @@ POSITIVE_REPLIES = [ "Of course!", "Aye aye, cap'n!", "I'll allow it.", -] +) -ERROR_REPLIES = [ +ERROR_REPLIES = ( "Please don't do that.", "You have to stop.", "Do you mind?", @@ -701,4 +672,4 @@ ERROR_REPLIES = [ "Are you trying to kill me?", "Noooooo!!", "I can't believe you've done this", -] +) |