Add owner ID and default subscriber settings

This commit is contained in:
2022-06-08 18:57:02 +01:00
parent edd49114f5
commit d54c860b16

View File

@@ -160,6 +160,16 @@ def main():
# Start bot
telegram_bot = TelegramSmsBot(token)
# Set the owner ID if configured
if 'SMSBOT_OWNER_ID' in os.environ:
telegram_bot.set_owner(os.environ.get('SMS_OWNER_ID'))
# Add default subscribers
if 'SMSBOT_DEFAULT_SUBSCRIBERS' in os.environ:
for chat_id in os.environ.get('SMSBOT_DEFAULT_SUBSCRIBERS').split(','):
telegram_bot.add_subscriber(chat_id)
telegram_bot.start()
# Start webhooks