Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in all my years online this is the first time the bot has died #71

Open
masbenny opened this issue Sep 16, 2024 · 1 comment
Open

in all my years online this is the first time the bot has died #71

masbenny opened this issue Sep 16, 2024 · 1 comment

Comments

@masbenny
Copy link

masbenny@home:~/shell-bot$ node server

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: From not present but not sent on channel
    at Message.parse (/home/masbenny/shell-bot/node_modules/botgram/lib/model.js:45:45)
    at Message.update (/home/masbenny/shell-bot/node_modules/botgram/lib/model.js:472:36)
    at Message.parse (/home/masbenny/shell-bot/node_modules/botgram/lib/model.js:89:29)
    at Bot.processMessage (/home/masbenny/shell-bot/node_modules/botgram/lib/message.js:28:35)
    at Bot.processUpdate (/home/masbenny/shell-bot/node_modules/botgram/lib/bot.js:250:19)
    at Array.forEach (<anonymous>)
    at Bot.<anonymous> (/home/masbenny/shell-bot/node_modules/botgram/lib/bot.js:218:12)
    at handleBody (/home/masbenny/shell-bot/node_modules/botgram/lib/bot.js:157:25)
    at IncomingMessage.<anonymous> (/home/masbenny/shell-bot/node_modules/botgram/lib/bot.js:146:33)
    at IncomingMessage.emit (events.js:203:15)
Emitted 'error' event at:
    at Bot.processMessage (/home/masbenny/shell-bot/node_modules/botgram/lib/message.js:32:10)
    at Bot.processUpdate (/home/masbenny/shell-bot/node_modules/botgram/lib/bot.js:250:19)
    [... lines matching original stack trace ...]
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
@masbenny
Copy link
Author

masbenny commented Sep 16, 2024

to keep the bot running I use this method

edit shell-bot/node_modules/botgram/lib/model.js

  if (msg.from !== undefined) {
    this.from = new Chat().parseUser(msg.from, options);
    delete msg.from;
  } /*else {
    if (this.chat.type !== "channel") throw new Error("From not present but not sent on channel");
    this.from = this.chat;
  }*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant