-
Notifications
You must be signed in to change notification settings - Fork 1
/
r.py
26 lines (19 loc) · 906 Bytes
/
r.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from dotenv import load_dotenv
from str2bool3 import str2bool
load_dotenv()
sandboxed = str2bool(os.getenv("QQBOT_SANDBOX"))
appid = os.getenv("QQBOT_APP_ID")
if appid is None:
raise Exception('Missing "QQBOT_APP_ID" environment variable for your bot AppID')
secret = os.getenv("QQBOT_APP_SECRET")
if secret is None:
raise Exception('Missing "QQBOT_APP_SECRET" environment variable for your AppSecret')
backend_elec = os.getenv("MIMIR_ELEC_URL", default="http://elec.mysit.life/v1")
backend_elec_token = os.getenv("MIMIR_ELEC_ADMIN_TOKEN")
weather_api_token = os.getenv("AMAP_WEATHER_API_TOKEN")
if weather_api_token is None:
raise Exception('Missing "AMAP_WEATHER_API_TOKEN" environment variable for your AppSecret')
forum_token = os.getenv("MIMIR_FORUM_TOKEN")
if forum_token is None:
raise Exception('Missing "MIMIR_FORUM_TOKEN" environment variable for your AppSecret')