Update app.py
Browse files
app.py
CHANGED
@@ -17,15 +17,16 @@ if not BOT_TOKEN:
|
|
17 |
application = Application.builder().token(BOT_TOKEN).build()
|
18 |
|
19 |
# Define the /start command handler
|
20 |
-
|
21 |
"""Sends a welcome message when the user starts the bot."""
|
22 |
-
|
23 |
|
24 |
# Add command handlers
|
25 |
application.add_handler(CommandHandler("start", start))
|
26 |
|
27 |
# Function to run the polling
|
28 |
def start_polling():
|
|
|
29 |
application.run_polling()
|
30 |
|
31 |
# Start a new thread to run polling
|
|
|
17 |
application = Application.builder().token(BOT_TOKEN).build()
|
18 |
|
19 |
# Define the /start command handler
|
20 |
+
def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
21 |
"""Sends a welcome message when the user starts the bot."""
|
22 |
+
update.message.reply_text("Hello! This bot is running in synchronous mode π")
|
23 |
|
24 |
# Add command handlers
|
25 |
application.add_handler(CommandHandler("start", start))
|
26 |
|
27 |
# Function to run the polling
|
28 |
def start_polling():
|
29 |
+
# Run the polling in blocking mode
|
30 |
application.run_polling()
|
31 |
|
32 |
# Start a new thread to run polling
|