fixed bug
Browse files- telegram_bot.py +3 -1
telegram_bot.py
CHANGED
|
@@ -52,16 +52,18 @@ async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
|
|
| 52 |
|
| 53 |
async def chat_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
| 54 |
"""Echo the user message."""
|
|
|
|
| 55 |
tic = time.perf_counter()
|
| 56 |
try:
|
| 57 |
message = {
|
| 58 |
"question": update.message.text,
|
| 59 |
-
"chat_id": update.message.chat.
|
| 60 |
}
|
| 61 |
print(message)
|
| 62 |
x = requests.post(ENDPOINT, json=message).json()
|
| 63 |
temp = time.perf_counter()
|
| 64 |
print(f"Received response in {temp - tic:0.4f} seconds")
|
|
|
|
| 65 |
result = x["result"]
|
| 66 |
print(result)
|
| 67 |
await update.message.reply_text(result[0:9500])
|
|
|
|
| 52 |
|
| 53 |
async def chat_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
| 54 |
"""Echo the user message."""
|
| 55 |
+
print(update)
|
| 56 |
tic = time.perf_counter()
|
| 57 |
try:
|
| 58 |
message = {
|
| 59 |
"question": update.message.text,
|
| 60 |
+
"chat_id": update.message.chat.id,
|
| 61 |
}
|
| 62 |
print(message)
|
| 63 |
x = requests.post(ENDPOINT, json=message).json()
|
| 64 |
temp = time.perf_counter()
|
| 65 |
print(f"Received response in {temp - tic:0.4f} seconds")
|
| 66 |
+
print(x)
|
| 67 |
result = x["result"]
|
| 68 |
print(result)
|
| 69 |
await update.message.reply_text(result[0:9500])
|