Update app.py
Browse files
app.py
CHANGED
|
@@ -19,12 +19,12 @@ async def telegram_webhook(request: Request):
|
|
| 19 |
def home():
|
| 20 |
return {"message": "Bot is running via webhook"}
|
| 21 |
|
| 22 |
-
@
|
| 23 |
def start_command(message):
|
| 24 |
-
|
| 25 |
|
| 26 |
if __name__ == "__main__":
|
| 27 |
-
|
| 28 |
listen="0.0.0.0", # Listen on all available network interfaces
|
| 29 |
port=7860, # Use the default FastAPI port (adjust as needed)
|
| 30 |
url_path="/webhook", # Must match the endpoint we defined
|
|
|
|
| 19 |
def home():
|
| 20 |
return {"message": "Bot is running via webhook"}
|
| 21 |
|
| 22 |
+
@app.message_handler(commands=["start"])
|
| 23 |
def start_command(message):
|
| 24 |
+
bot.reply_to(message, "Hello! I'm running via FastAPI webhook!")
|
| 25 |
|
| 26 |
if __name__ == "__main__":
|
| 27 |
+
bot.run_webhooks(
|
| 28 |
listen="0.0.0.0", # Listen on all available network interfaces
|
| 29 |
port=7860, # Use the default FastAPI port (adjust as needed)
|
| 30 |
url_path="/webhook", # Must match the endpoint we defined
|