aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-04-02 17:37:47 -0500
committerParker <contact@pkrm.dev>2024-04-02 17:37:47 -0500
commit2b5f802017b6332e026cceb1d0ef26c3b9bc0c52 (patch)
tree0af5c594b721c60ae509138e95fdba0cc7a1a7b6 /code
parente5aefb55a7815c9a8337216e5435db900c205cc5 (diff)
Add BOT_INVITE_LINK config option
Diffstat (limited to 'code')
-rw-r--r--code/global_variables.py1
-rw-r--r--code/validate_config.py9
2 files changed, 10 insertions, 0 deletions
diff --git a/code/global_variables.py b/code/global_variables.py
index cf956eb..31d0df2 100644
--- a/code/global_variables.py
+++ b/code/global_variables.py
@@ -48,6 +48,7 @@ BOT_TOKEN = config["BOT_INFO"]["TOKEN"]
BOT_COLOR = discord.Color(int((config["BOT_INFO"]["BOT_COLOR"]).replace("#", ""), 16))
FEEDBACK_CHANNEL_ID = int(config["BOT_INFO"]["FEEDBACK_CHANNEL_ID"])
BUG_CHANNEL_ID = int(config["BOT_INFO"]["BUG_CHANNEL_ID"])
+BOT_INVITE_LINK = config["BOT_INFO"]["BOT_INVITE_LINK"]
LAVALINK_HOST = config["LAVALINK"]["HOST"]
LAVALINK_PORT = config["LAVALINK"]["PORT"]
diff --git a/code/validate_config.py b/code/validate_config.py
index d4d9786..8a03c3e 100644
--- a/code/validate_config.py
+++ b/code/validate_config.py
@@ -1,5 +1,6 @@
import configparser
import re
+import validators
from global_variables import LOG
@@ -45,6 +46,14 @@ def validate_config(file_contents):
elif len(config["BOT_INFO"]["BUG_CHANNEL_ID"]) != 19:
LOG.critical("BUG_CHANNEL_ID is not a valid Discord channel ID.")
errors += 1
+ # Validate BOT_INVITE_LINK
+ if not config["BOT_INFO"]["BOT_INVITE_LINK"]:
+ LOG.critical("BOT_INVITE_LINK has not been set.")
+ errors += 1
+
+ elif not validators.url(config["BOT_INFO"]["BOT_INVITE_LINK"]):
+ LOG.critical("BOT_INVITE_LINK is not a valid URL.")
+ errors += 1
# Validate LAVALINK
# Validate HOST