2020-04-27 08:05:17 +00:00
|
|
|
import os
|
|
|
|
from pathlib import Path
|
2020-04-29 23:04:54 +00:00
|
|
|
from time import time
|
2020-04-27 08:05:17 +00:00
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
"TOKEN",
|
2020-04-27 10:35:02 +00:00
|
|
|
"Role",
|
2020-04-27 08:05:17 +00:00
|
|
|
"PROBLEMS",
|
|
|
|
"MAX_REFUSE",
|
|
|
|
"ROUND_NAMES",
|
2020-04-27 22:23:43 +00:00
|
|
|
"TEAMS_CHANNEL_CATEGORY",
|
2020-04-28 10:03:36 +00:00
|
|
|
"DIEGO",
|
2020-04-28 16:34:46 +00:00
|
|
|
"TOURNOIS",
|
2020-04-29 14:27:40 +00:00
|
|
|
"EMBED_COLOR",
|
2020-05-01 15:08:05 +00:00
|
|
|
"FRACTAL_URL",
|
2020-04-29 23:04:54 +00:00
|
|
|
"File",
|
|
|
|
"Emoji",
|
2020-04-27 08:05:17 +00:00
|
|
|
]
|
|
|
|
|
2020-04-29 14:27:40 +00:00
|
|
|
|
2020-04-27 08:05:17 +00:00
|
|
|
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"
|
2020-04-28 10:03:36 +00:00
|
|
|
DIEGO = "Diego" # Mon display name
|
2020-04-29 23:04:54 +00:00
|
|
|
TEAMS_CHANNEL_CATEGORY = "Channels d'équipes"
|
|
|
|
EMBED_COLOR = 0xFFA500
|
2020-05-01 15:08:05 +00:00
|
|
|
FRACTAL_URL = "https://thefractal.space/img/{seed}.png?size=1500"
|
|
|
|
|
2020-04-29 23:04:54 +00:00
|
|
|
ROUND_NAMES = ["premier tour", "deuxième tour"]
|
2020-04-28 16:34:46 +00:00
|
|
|
TOURNOIS = [
|
|
|
|
"Lille",
|
|
|
|
"Lyon",
|
|
|
|
"Paris-Saclay",
|
2020-05-01 17:45:18 +00:00
|
|
|
"Paris-Avignon-Est",
|
2020-04-28 16:34:46 +00:00
|
|
|
"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"
|
2020-04-27 18:03:51 +00:00
|
|
|
PARTICIPANT = "Participant"
|
2020-05-02 14:19:45 +00:00
|
|
|
TOURIST = "Touriste"
|
2020-04-27 10:35:02 +00:00
|
|
|
|
2020-04-27 08:05:17 +00:00
|
|
|
|
2020-04-29 23:04:54 +00:00
|
|
|
class Emoji:
|
|
|
|
JOY = "😂"
|
|
|
|
SOB = "😭"
|
2020-04-30 15:26:33 +00:00
|
|
|
BIN = "🗑️"
|
|
|
|
DICE = "🎲"
|
2020-05-01 15:08:05 +00:00
|
|
|
CHECK = "✅"
|
2020-04-27 22:23:43 +00:00
|
|
|
|
2020-04-27 08:05:17 +00:00
|
|
|
|
2020-04-29 23:04:54 +00:00
|
|
|
class File:
|
|
|
|
TOP_LEVEL = Path(__file__).parent.parent
|
|
|
|
TIRAGES = TOP_LEVEL / "data" / "tirages.yaml"
|
|
|
|
TEAMS = TOP_LEVEL / "data" / "teams"
|
|
|
|
JOKES = TOP_LEVEL / "data" / "jokes"
|
|
|
|
|
2020-04-27 11:34:55 +00:00
|
|
|
|
2020-04-29 23:04:54 +00:00
|
|
|
with open(File.TOP_LEVEL / "data" / "problems") as f:
|
2020-04-27 11:34:55 +00:00
|
|
|
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
|
2020-04-30 15:26:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
def setup(bot):
|
|
|
|
# Just so we can reload the constants
|
|
|
|
pass
|