diff options
| author | 2022-09-18 22:03:34 +0100 | |
|---|---|---|
| committer | 2022-09-18 22:03:34 +0100 | |
| commit | 46d1e8ddb217f1bb5e07179b32db50b6a04b6de8 (patch) | |
| tree | c3f4db63c2751c51acfee97d016551b8f677e29b /bot/constants.py | |
| parent | Remove unnecessary hasattr check (diff) | |
| parent | Fix Poetry 1.2 Support (#1099) (diff) | |
Merge branch 'main' into fix-whitelist-inheritance
Diffstat (limited to 'bot/constants.py')
| -rw-r--r-- | bot/constants.py | 28 | 
1 files changed, 20 insertions, 8 deletions
| diff --git a/bot/constants.py b/bot/constants.py index 3b426c47..eb9ee4b3 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -12,6 +12,7 @@ __all__ = (      "Channels",      "Categories",      "Client", +    "Logging",      "Colours",      "Emojis",      "Icons", @@ -23,7 +24,7 @@ __all__ = (      "Reddit",      "RedisConfig",      "RedirectOutput", -    "PYTHON_PREFIX" +    "PYTHON_PREFIX",      "MODERATION_ROLES",      "STAFF_ROLES",      "WHITELISTED_CHANNELS", @@ -37,6 +38,7 @@ log = logging.getLogger(__name__)  PYTHON_PREFIX = "!" +  @dataclasses.dataclass  class AdventOfCodeLeaderboard:      id: str @@ -53,7 +55,7 @@ class AdventOfCodeLeaderboard:      def session(self) -> str:          """Return either the actual `session` cookie or the fallback cookie."""          if self.use_fallback_session: -            log.info(f"Returning fallback cookie for board `{self.id}`.") +            log.trace(f"Returning fallback cookie for board `{self.id}`.")              return AdventOfCode.fallback_session          return self._session @@ -107,8 +109,11 @@ class Cats:  class Channels(NamedTuple):      advent_of_code = int(environ.get("AOC_CHANNEL_ID", 897932085766004786))      advent_of_code_commands = int(environ.get("AOC_COMMANDS_CHANNEL_ID", 897932607545823342)) -    bot = 267659945086812160 +    algos_and_data_structs = 650401909852864553 +    bot_commands = 267659945086812160 +    community_meta = 267659945086812160      organisation = 551789653284356126 +    data_science_and_ai = 366673247892275221      devlog = int(environ.get("CHANNEL_DEVLOG", 622895325144940554))      dev_contrib = 635950537262759947      mod_meta = 775412552795947058 @@ -116,7 +121,7 @@ class Channels(NamedTuple):      off_topic_0 = 291284109232308226      off_topic_1 = 463035241142026251      off_topic_2 = 463035268514185226 -    community_bot_commands = int(environ.get("CHANNEL_COMMUNITY_BOT_COMMANDS", 607247579608121354)) +    sir_lancebot_playground = int(environ.get("CHANNEL_COMMUNITY_BOT_COMMANDS", 607247579608121354))      voice_chat_0 = 412357430186344448      voice_chat_1 = 799647045886541885      staff_voice = 541638762007101470 @@ -130,23 +135,31 @@ class Categories(NamedTuple):      media = 799054581991997460      staff = 364918151625965579 +  codejam_categories_name = "Code Jam"  # Name of the codejam team categories +  class Client(NamedTuple):      name = "Sir Lancebot"      guild = int(environ.get("BOT_GUILD", 267624335836053506))      prefix = environ.get("PREFIX", ".")      token = environ.get("BOT_TOKEN")      debug = environ.get("BOT_DEBUG", "true").lower() == "true" -    file_logs = environ.get("FILE_LOGS", "false").lower() == "true" +    in_ci = environ.get("IN_CI", "false").lower() == "true"      github_bot_repo = "https://github.com/python-discord/sir-lancebot"      # Override seasonal locks: 1 (January) to 12 (December)      month_override = int(environ["MONTH_OVERRIDE"]) if "MONTH_OVERRIDE" in environ else None + + +class Logging(NamedTuple): +    debug = Client.debug +    file_logs = environ.get("FILE_LOGS", "false").lower() == "true"      trace_loggers = environ.get("BOT_TRACE_LOGGERS")  class Colours:      blue = 0x0279FD +    twitter_blue = 0x1DA1F2      bright_green = 0x01D277      dark_green = 0x1F8B4C      orange = 0xE67E22 @@ -231,7 +244,6 @@ class Emojis:      status_dnd = "<:status_dnd:470326272082313216>"      status_offline = "<:status_offline:470326266537705472>" -      stackoverflow_tag = "<:stack_tag:870926975307501570>"      stackoverflow_views = "<:stack_eye:870926992692879371>" @@ -343,8 +355,8 @@ STAFF_ROLES = {Roles.helpers, Roles.moderation_team, Roles.admins, Roles.owners}  # Whitelisted channels  WHITELISTED_CHANNELS = ( -    Channels.bot, -    Channels.community_bot_commands, +    Channels.bot_commands, +    Channels.sir_lancebot_playground,      Channels.off_topic_0,      Channels.off_topic_1,      Channels.off_topic_2, | 
