Compare commits

...

1 Commits

Author SHA1 Message Date
Chris Watson 72178efcf0 check env vars before starting 2024-06-13 11:01:56 -06:00
1 changed files with 4 additions and 0 deletions

View File

@ -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)