31 lines
786 B
Python
31 lines
786 B
Python
|
|
import discord_api
|
|
import tiss
|
|
|
|
from dotenv import load_dotenv
|
|
import os
|
|
|
|
try: import tomllib
|
|
except ModuleNotFoundError: import pip._vendor.tomli as tomllib
|
|
|
|
|
|
load_dotenv()
|
|
|
|
if __name__ == '__main__':
|
|
# course_nr = tiss.TISS.get_code_from_any('https://tiss.tuwien.ac.at/course/courseDetails.xhtml?dswid=7270&dsrid=953&courseNr=186140&semester=2024W')
|
|
# lva = tiss.TISS.get_lva(course_nr)
|
|
|
|
# print(lva)
|
|
# print(lva.curricula)
|
|
|
|
config_file = os.getenv("CONFIG_FILE", "config.toml")
|
|
discord_token = os.getenv("DISCORD_TOKEN")
|
|
|
|
if discord_token is None:
|
|
print("[ERROR] Please set the DISCORD_TOKEN environment variable")
|
|
exit()
|
|
|
|
with open(config_file, "rb") as f:
|
|
config = tomllib.load(f)
|
|
|
|
discord_api.run(discord_token, config) |