telegram: Add options for API_ID and API_HASH
patch cd15d391cfdd3f1db483a5235ac7233eb912e03e
Author: E. Bosch <presidev@AT@gmail.com>
Date: Wed Feb 16 02:18:10 CET 2022
* telegram: Add options for API_ID and API_HASH
hunk ./irgramd 62
+ tornado.options.define('api_hash', default=None, metavar='HASH', help='Telegram API Hash for your account (obtained from https://my.telegram.org/apps)')
+ tornado.options.define('api_id', type=int, default=None, metavar='ID', help='Telegram API ID for your account (obtained from https://my.telegram.org/apps)')
hunk ./telegram.py 14
-
-# Configuration
-
-# GET API_ID and API_HASH from https://my.telegram.org/apps
-# AND PUT HERE BEFORE RUNNING irgramd
-
-TELEGRAM_API_ID =
-TELEGRAM_API_HASH = ''
-
hunk ./telegram.py 22
+ self.api_id = settings['api_id']
+ self.api_hash = settings['api_hash']
hunk ./telegram.py 46
- self.telegram_client = telethon.TelegramClient(telegram_session,
- TELEGRAM_API_ID, TELEGRAM_API_HASH
- )
+ self.telegram_client = telethon.TelegramClient(telegram_session, self.api_id, self.api_hash)