DeMaking commited on
Commit
a2c6413
·
verified ·
1 Parent(s): 0356504

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -55,19 +55,19 @@ def start_telegram_bot():
55
  print("Start command received.")
56
 
57
 
58
- async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE):
59
- user_text = update.message.text
60
- print(f"User message: {user_text}")
61
 
62
- # Send the user text to the FastAPI server and get the response.
63
- result = await call_hugging_face_space(user_text)
64
- response_text = result.get("response", "Error generating response.")
65
 
66
- print(f"API Response: {response_text}")
67
- await update.message.reply_text(response_text)
68
 
69
  application.add_handler(CommandHandler("start", start))
70
- application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_message))
71
 
72
  # Start the bot
73
  application.run_polling()
 
55
  print("Start command received.")
56
 
57
 
58
+ # async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE):
59
+ # user_text = update.message.text
60
+ # print(f"User message: {user_text}")
61
 
62
+ # # Send the user text to the FastAPI server and get the response.
63
+ # result = await call_hugging_face_space(user_text)
64
+ # response_text = result.get("response", "Error generating response.")
65
 
66
+ # print(f"API Response: {response_text}")
67
+ # await update.message.reply_text(response_text)
68
 
69
  application.add_handler(CommandHandler("start", start))
70
+ # application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_message))
71
 
72
  # Start the bot
73
  application.run_polling()