tfjm-discord-bot/src/constants.py

67 lines
1.4 KiB
Python
Raw Normal View History

import os
from pathlib import Path
__all__ = [
"TOKEN",
2020-04-27 10:35:02 +00:00
"Role",
"PROBLEMS",
"MAX_REFUSE",
"ROUND_NAMES",
"TIRAGES_FILE",
2020-04-27 12:46:04 +00:00
"TEAMS_FILE",
2020-04-28 18:25:27 +00:00
"JOKES_FILE",
"TEAMS_CHANNEL_CATEGORY",
"DIEGO",
2020-04-28 16:34:46 +00:00
"TOURNOIS",
]
TOKEN = os.environ.get("TFJM_DISCORD_TOKEN")
if TOKEN is None:
print("No token for the bot were found.")
print("You need to set the TFJM_DISCORD_TOKEN variable in your environement")
print("Or just run:")
print()
print(f' TFJM_DISCORD_TOKEN="your token here" python tfjm-discord-bot.py')
print()
quit(1)
GUILD = "690934836696973404"
DIEGO = "Diego" # Mon display name
2020-04-27 10:35:02 +00:00
2020-04-28 16:34:46 +00:00
TOURNOIS = [
"Lille",
"Lyon",
"Paris-Saclay",
"Avignon",
"Paris-Est",
"Tours",
"Bordeaux",
"Nancy",
"Rennes",
]
2020-04-27 10:35:02 +00:00
class Role:
CNO = "CNO"
DEV = "dev"
ORGA = "Orga"
2020-04-28 16:34:46 +00:00
ORGAS = tuple(f"Orga {t}" for t in TOURNOIS)
2020-04-27 10:35:02 +00:00
BENEVOLE = "Bénévole"
CAPTAIN = "Capitaine"
PARTICIPANT = "Participant"
2020-04-27 10:35:02 +00:00
TEAMS_CHANNEL_CATEGORY = "Channels d'équipes"
ROUND_NAMES = ["premier tour", "deuxième tour"]
TOP_LEVEL_DIR = Path(__file__).parent.parent
TIRAGES_FILE = TOP_LEVEL_DIR / "data" / "tirages.yaml"
2020-04-27 12:46:04 +00:00
TEAMS_FILE = TOP_LEVEL_DIR / "data" / "teams"
2020-04-28 18:25:27 +00:00
JOKES_FILE = TOP_LEVEL_DIR / "data" / "jokes"
with open(TOP_LEVEL_DIR / "data" / "problems") as f:
PROBLEMS = f.read().splitlines()
2020-04-28 19:03:35 +00:00
MAX_REFUSE = len(PROBLEMS) - 4 # -5 usually but not in 2020 because of covid-19