Leask / halbot

Just another `ChatGPT` / `Gemini` / `Mistral (by ollama)` Telegram bob, which is simple design, easy to use, extendable and fun.
https://leaskh.com/post/711636926789271552/halbot
MIT License
101 stars 16 forks source link

crash because of suggested reply buttons? #10

Closed kamil-malinski closed 1 year ago

kamil-malinski commented 1 year ago

I just experienced this crash:

[HAL] Prompt: Hallo!
file:///root/halbot/node_modules/utilitas/lib/bot.mjs:129
            if (data?.text && ctx.session.textButtons[data?.text]) {
                                                     ^

TypeError: Cannot read properties of undefined (reading 'ddd49ab7-2c49-ca8e-c31f-78e88137d4bb')
    at func (file:///root/halbot/node_modules/utilitas/lib/bot.mjs:129:54)
    at execute (/root/halbot/node_modules/telegraf/lib/composer.js:485:23)
    at /root/halbot/node_modules/telegraf/lib/composer.js:486:27
    at execute (/root/halbot/node_modules/telegraf/lib/composer.js:485:23)
    at /root/halbot/node_modules/telegraf/lib/composer.js:486:27
    at func (file:///root/halbot/node_modules/utilitas/lib/bot.mjs:96:15)
    at execute (/root/halbot/node_modules/telegraf/lib/composer.js:485:23)
    at /root/halbot/node_modules/telegraf/lib/composer.js:486:27
    at execute (/root/halbot/node_modules/telegraf/lib/composer.js:485:23)
    at /root/halbot/node_modules/telegraf/lib/composer.js:486:27
Leask commented 1 year ago

Oops, I need to initial the session before using it. Thanks! A quick fix is uploading.

Leask commented 1 year ago

Fixed. 🍻