aboutsummaryrefslogtreecommitdiffstats
path: root/bot/constants.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/constants.py')
-rw-r--r--bot/constants.py97
1 files changed, 66 insertions, 31 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 051bd62a..1a2763f0 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -1,22 +1,32 @@
+import enum
import logging
+from datetime import datetime
from os import environ
from typing import NamedTuple
-from datetime import datetime
__all__ = (
- "bookmark_icon_url",
- "AdventOfCode", "Channels", "Client", "Colours", "Emojis", "Hacktoberfest", "Roles", "Tokens",
- "WHITELISTED_CHANNELS", "STAFF_ROLES", "MODERATION_ROLES",
- "POSITIVE_REPLIES", "NEGATIVE_REPLIES", "ERROR_REPLIES",
+ "AdventOfCode",
+ "Branding",
+ "Channels",
+ "Client",
+ "Colours",
+ "Emojis",
+ "Hacktoberfest",
+ "Icons",
+ "Lovefest",
+ "Month",
+ "Roles",
+ "Tokens",
+ "MODERATION_ROLES",
+ "STAFF_ROLES",
+ "WHITELISTED_CHANNELS",
+ "ERROR_REPLIES",
+ "NEGATIVE_REPLIES",
+ "POSITIVE_REPLIES",
)
log = logging.getLogger(__name__)
-bookmark_icon_url = (
- "https://images-ext-2.discordapp.net/external/zl4oDwcmxUILY7sD9ZWE2fU5R7n6QcxEmPYSE5eddbg/"
- "%3Fv%3D1/https/cdn.discordapp.com/emojis/654080405988966419.png?width=20&height=20"
-)
-
class AdventOfCode:
leaderboard_cache_age_threshold_seconds = 3600
@@ -27,6 +37,11 @@ class AdventOfCode:
role_id = int(environ.get("AOC_ROLE_ID", 518565788744024082))
+class Branding:
+ cycle_frequency = int(environ.get("CYCLE_FREQUENCY", 3)) # 0: never, 1: every day, 2: every other day, ...
+ autostart = environ.get("BRANDING_AUTOSTART", "").lower() == "true" # Launch the branding daemon on start-up
+
+
class Channels(NamedTuple):
admins = 365960823622991872
advent_of_code = int(environ.get("AOC_CHANNEL_ID", 517745814039166986))
@@ -36,7 +51,6 @@ class Channels(NamedTuple):
checkpoint_test = 422077681434099723
devalerts = 460181980097675264
devlog = int(environ.get("CHANNEL_DEVLOG", 622895325144940554))
- devtest = 414574275865870337
help_0 = 303906576991780866
help_1 = 303906556754395136
help_2 = 303906514266226689
@@ -68,8 +82,6 @@ class Client(NamedTuple):
token = environ.get("SEASONALBOT_TOKEN")
sentry_dsn = environ.get("SEASONALBOT_SENTRY_DSN")
debug = environ.get("SEASONALBOT_DEBUG", "").lower() == "true"
- season_override = environ.get("SEASON_OVERRIDE")
- icon_cycle_frequency = 3 # N days to wait between cycling server icons within a single season
class Colours:
@@ -90,6 +102,7 @@ class Emojis:
check = "\u2611"
envelope = "\U0001F4E8"
trashcan = "<:trashcan:637136429717389331>"
+ ok_hand = ":ok_hand:"
terning1 = "<:terning1:431249668983488527>"
terning2 = "<:terning2:462339216987127808>"
@@ -105,16 +118,35 @@ class Emojis:
merge = "<:PRMerged:629695470570176522>"
+class Hacktoberfest(NamedTuple):
+ voice_id = 514420006474219521
+
+
class Icons:
questionmark = "https://cdn.discordapp.com/emojis/512367613339369475.png"
+ bookmark = (
+ "https://images-ext-2.discordapp.net/external/zl4oDwcmxUILY7sD9ZWE2fU5R7n6QcxEmPYSE5eddbg/"
+ "%3Fv%3D1/https/cdn.discordapp.com/emojis/654080405988966419.png?width=20&height=20"
+ )
class Lovefest:
role_id = int(environ.get("LOVEFEST_ROLE_ID", 542431903886606399))
-class Hacktoberfest(NamedTuple):
- voice_id = 514420006474219521
+class Month(enum.IntEnum):
+ january = 1
+ february = 2
+ march = 3
+ april = 4
+ may = 5
+ june = 6
+ july = 7
+ august = 8
+ september = 9
+ october = 10
+ november = 11
+ december = 12
class Roles(NamedTuple):
@@ -140,6 +172,7 @@ class Tokens(NamedTuple):
youtube = environ.get("YOUTUBE_API_KEY")
tmdb = environ.get("TMDB_API_KEY")
igdb = environ.get("IGDB_API_KEY")
+ github = environ.get("GITHUB_TOKEN")
# Default role combinations
@@ -148,12 +181,27 @@ STAFF_ROLES = Roles.helpers, Roles.moderator, Roles.admin, Roles.owner
# Whitelisted channels
WHITELISTED_CHANNELS = (
- Channels.bot, Channels.seasonalbot_commands,
- Channels.off_topic_0, Channels.off_topic_1, Channels.off_topic_2,
- Channels.devtest,
+ Channels.bot,
+ Channels.seasonalbot_commands,
+ Channels.off_topic_0,
+ Channels.off_topic_1,
+ Channels.off_topic_2,
)
# Bot replies
+ERROR_REPLIES = [
+ "Please don't do that.",
+ "You have to stop.",
+ "Do you mind?",
+ "In the future, don't do that.",
+ "That was a mistake.",
+ "You blew it.",
+ "You're bad at computers.",
+ "Are you trying to kill me?",
+ "Noooooo!!",
+ "I can't believe you've done this",
+]
+
NEGATIVE_REPLIES = [
"Noooooo!!",
"Nope.",
@@ -193,16 +241,3 @@ POSITIVE_REPLIES = [
"Aye aye, cap'n!",
"I'll allow it.",
]
-
-ERROR_REPLIES = [
- "Please don't do that.",
- "You have to stop.",
- "Do you mind?",
- "In the future, don't do that.",
- "That was a mistake.",
- "You blew it.",
- "You're bad at computers.",
- "Are you trying to kill me?",
- "Noooooo!!",
- "I can't believe you've done this",
-]