RainEggplant / chatgpt-telegram-bot

A ChatGPT bot for Telegram based on Node.js. Support both browserless and browser-base APIs.
MIT License
323 stars 97 forks source link

Is it available to increase timeout between message edits in telegram from bot? #10

Closed lgg closed 1 year ago

lgg commented 1 year ago

I'm receiving timeout from Telegram for editing message:

I'm using: "v3" (browser-based)

package.json:

  "dependencies": {
    "chatgpt": "4.3.2",
    "chatgpt-v3": "npm:chatgpt@3.5.1",
    "config": "^3.3.9",
    "dotenv": "^16.0.3",
    "lodash": "^4.17.21",
    "node-telegram-bot-api": "^0.60.0",
    "puppeteer": "^19.7.0"
  }
 offset 305
2/17/2023, 9:13:18 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:23 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:26 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:30 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:38 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:42 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:46 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:50 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:53 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:13:56 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:01 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:04 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:07 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:11 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:14 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:17 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:21 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:26 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:30 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:33 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305
2/17/2023, 9:14:35 AM ⛔️ Edit message error: ETELEGRAM: 400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 305

I faced this issue with long code output. Short text answers works fine

RainEggplant commented 1 year ago

Try increasing the value here (it's 3000 ms currently): https://github.com/RainEggplant/chatgpt-telegram-bot/blob/543d16ed1c6eb63f37b542c47b2d905f8391b559/src/handlers/chat.ts#L54

lgg commented 1 year ago

Thank you