tfjm-discord-bot/src/constants.py

115 lines
2.5 KiB
Python
Raw Normal View History

import os
from pathlib import Path
2020-04-29 23:04:54 +00:00
from time import time
__all__ = [
"DISCORD_TOKEN",
"TFJM_TOKEN",
2020-04-27 10:35:02 +00:00
"Role",
"PROBLEMS",
"MAX_REFUSE",
"ROUND_NAMES",
"TEAMS_CHANNEL_CATEGORY",
"DIEGO",
"ANANAS",
2020-05-19 15:11:35 +00:00
"YOHANN",
"FAN_CLUBS",
2020-05-04 14:16:06 +00:00
"BOT",
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",
"FRACTAL_COOLDOWN",
2020-04-29 23:04:54 +00:00
"File",
"Emoji",
]
2020-04-29 14:27:40 +00:00
DISCORD_TOKEN = os.environ.get("TFJM_DISCORD_TOKEN")
TFJM_TOKEN = os.environ.get("TFJM_ORG_TOKEN")
if DISCORD_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-05-04 14:16:06 +00:00
DIEGO = 430566197868625920 # Mon id
ANANAS = 619132180408303616
2020-05-18 14:13:53 +00:00
YOHANN = 157252601119899648
FAN_CLUBS = {
DIEGO: 706586020841259078,
ANANAS: 706586027535368223,
2020-05-18 14:13:53 +00:00
YOHANN: 711707591847444610,
}
2020-05-18 14:13:53 +00:00
2020-05-04 14:16:06 +00:00
BOT = 703305132300959754
TEAMS_CHANNEL_CATEGORY = "Channels d'équipes 2"
2020-04-29 23:04:54 +00:00
EMBED_COLOR = 0xFFA500
FRACTAL_URL = "https://thefractal.space/img/{seed}.png?size=1000"
FRACTAL_COOLDOWN = 30 # seconds
2020-05-01 15:08:05 +00:00
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",
2020-05-08 08:44:40 +00:00
"Bordeaux-Nancy",
2020-04-28 16:34:46 +00:00
"Rennes",
"Finale",
2020-04-28 16:34:46 +00:00
]
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-05-12 09:27:40 +00:00
JURY = tuple(f"Jury {t}" for t in TOURNOIS)
2020-04-27 10:35:02 +00:00
BENEVOLE = "Bénévole"
CAPTAIN = "Capitaine"
FINALISTE = "Finaliste"
PARTICIPANT = "Participant"
2020-05-02 14:19:45 +00:00
TOURIST = "Touriste"
2020-05-17 13:06:37 +00:00
PRETRESSE_CALINS = "Grande prêtresse des câlins"
2020-04-27 10:35:02 +00:00
2020-04-29 23:04:54 +00:00
class Emoji:
2020-05-18 17:20:21 +00:00
HEART = "❤️"
2020-04-29 23:04:54 +00:00
JOY = "😂"
SOB = "😭"
2020-04-30 15:26:33 +00:00
BIN = "🗑️"
DICE = "🎲"
2020-05-01 15:08:05 +00:00
CHECK = ""
CROSS = ""
2020-05-04 14:16:06 +00:00
PLUS_1 = "👍"
MINUS_1 = "👎"
RAINBOW_HEART = "<:rainbow_heart:714172834632564818>"
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-05-04 14:16:06 +00:00
JOKES_V2 = TOP_LEVEL / "data" / "jokesv2"
2020-05-10 10:43:21 +00:00
MEMES = TOP_LEVEL / "data" / "memes"
2020-05-17 13:06:37 +00:00
HUGS = TOP_LEVEL / "data" / "hugs"
2020-04-29 23:04:54 +00:00
2020-04-29 23:04:54 +00:00
with open(File.TOP_LEVEL / "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
2020-04-30 15:26:33 +00:00
def setup(bot):
# Just so we can reload the constants
pass