mirror of
https://gitlab.com/MisterBiggs/multi-bot-tutorial.git
synced 2025-09-19 03:52:45 +00:00
operational version of telegram bot
This commit is contained in:
@@ -24,11 +24,13 @@ def start(bot, update):
|
||||
update.message.reply_text("I am started and ready to go!")
|
||||
|
||||
|
||||
def nextRocketLaunch():
|
||||
nextLaunch()
|
||||
|
||||
def nextRocketLaunch(bot, update):
|
||||
launch = nextLaunch()
|
||||
|
||||
message = f"The **{launch['mission']}** is in {launch['countdown']}\n\n"
|
||||
message += f"The Mission is using the {launch['rocket']} and you can watch the mission live [here]({launch['video']})"
|
||||
|
||||
update.message.reply_text(text=message, parse_mode=telegram.ParseMode.MARKDOWN)
|
||||
|
||||
|
||||
def error(bot, update, error):
|
||||
@@ -46,7 +48,7 @@ def main():
|
||||
|
||||
# on different commands - answer in Telegram
|
||||
dp.add_handler(CommandHandler("start", start))
|
||||
dp.add_handler(CommandHandler("Launch", nextRocketLaunch))
|
||||
dp.add_handler(CommandHandler("launch", nextRocketLaunch))
|
||||
|
||||
# log all errors
|
||||
dp.add_error_handler(error)
|
||||
|
Reference in New Issue
Block a user