1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 11:34:18 +00:00

New configuration system, this time for real

This commit is contained in:
Steffo 2017-03-29 09:32:38 +02:00
parent c6e34f6ae1
commit 60f10fa72e
2 changed files with 19 additions and 3 deletions

3
.gitignore vendored
View file

@ -92,9 +92,6 @@ ENV/
.idea/
# config file
royalbotconfig.py
# grandbot.py files
diario.txt

19
royalbotconfig.py Normal file
View file

@ -0,0 +1,19 @@
import os
class MissingTokenError(Exception):
pass
if "telegram_token" in os.environ:
telegram_token = os.environ["telegram_token"]
else:
raise MissingTokenError("telegram_token")
if "discord_token" in os.environ:
discord_token = os.environ["discord_token"]
else:
raise MissingTokenError("discord_token")
if "discord_webhook" in os.environ:
discord_webhook = os.environ["discord_webhook"]
else:
raise MissingTokenError("discord_webhook")