check env vars before starting
This commit is contained in:
parent
ebd352cf80
commit
72178efcf0
|
@ -12,6 +12,10 @@ api_id = os.environ.get('APP_ID')
|
|||
api_hash = os.environ.get('APP_HASH')
|
||||
phone_number = os.environ.get('TG_PHONE')
|
||||
|
||||
for var in [api_id, api_hash, phone_number]:
|
||||
if not var:
|
||||
raise ValueError('Environment variable not set')
|
||||
|
||||
session = SQLiteSession('fenneko-' + phone_number)
|
||||
client = TelegramClient(session, api_id, api_hash)
|
||||
|
||||
|
|
Loading…
Reference in New Issue