Skip to content

Commit 74d97b0

Browse files
committed
Fixed a bug that made the bot fail the startup.
1 parent 9ec98d8 commit 74d97b0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tg_bot/__main__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,11 @@ def main():
462462
# dispatcher.add_error_handler(error_callback)
463463

464464
# Restarting bot message
465-
dispatcher.bot.sendMessage(chat_id=int(DEFAULT_CHAT_ID),
466-
text="Sistema *riavviato*.\nVersione: {}".format(str(VERSION)),
467-
parse_mode=ParseMode.MARKDOWN)
465+
466+
if DEFAULT_CHAT_ID:
467+
dispatcher.bot.sendMessage(chat_id=int(DEFAULT_CHAT_ID),
468+
text="Sistema *riavviato*.\nVersione: {}".format(str(VERSION)),
469+
parse_mode=ParseMode.MARKDOWN)
468470

469471
# add antiflood processor
470472
Dispatcher.process_update = process_update

0 commit comments

Comments
 (0)