Add BOT_INVITE_LINK config option

This commit is contained in:
Parker M. 2024-04-02 17:37:47 -05:00
parent e5aefb55a7
commit 2b5f802017
No known key found for this signature in database
GPG Key ID: 95CD2E0C7E329F2A
3 changed files with 11 additions and 0 deletions

View File

@ -48,6 +48,7 @@ BOT_TOKEN = config["BOT_INFO"]["TOKEN"]
BOT_COLOR = discord.Color(int((config["BOT_INFO"]["BOT_COLOR"]).replace("#", ""), 16)) BOT_COLOR = discord.Color(int((config["BOT_INFO"]["BOT_COLOR"]).replace("#", ""), 16))
FEEDBACK_CHANNEL_ID = int(config["BOT_INFO"]["FEEDBACK_CHANNEL_ID"]) FEEDBACK_CHANNEL_ID = int(config["BOT_INFO"]["FEEDBACK_CHANNEL_ID"])
BUG_CHANNEL_ID = int(config["BOT_INFO"]["BUG_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_HOST = config["LAVALINK"]["HOST"]
LAVALINK_PORT = config["LAVALINK"]["PORT"] LAVALINK_PORT = config["LAVALINK"]["PORT"]

View File

@ -1,5 +1,6 @@
import configparser import configparser
import re import re
import validators
from global_variables import LOG from global_variables import LOG
@ -45,6 +46,14 @@ def validate_config(file_contents):
elif len(config["BOT_INFO"]["BUG_CHANNEL_ID"]) != 19: elif len(config["BOT_INFO"]["BUG_CHANNEL_ID"]) != 19:
LOG.critical("BUG_CHANNEL_ID is not a valid Discord channel ID.") LOG.critical("BUG_CHANNEL_ID is not a valid Discord channel ID.")
errors += 1 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 LAVALINK
# Validate HOST # Validate HOST

View File

@ -3,6 +3,7 @@ token =
bot_color = bot_color =
feedback_channel_id = feedback_channel_id =
bug_channel_id = bug_channel_id =
bot_invite_link =
[LAVALINK] [LAVALINK]
host = host =