Skip to content

Commit

Permalink
fix: app crashing when bot is muted
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnabXD committed Mar 21, 2022
1 parent 197b073 commit dcae3ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import { TestFFMPEG } from './ffmpeg';
bot.on('inline_query', (ctx) => ctx.answerInlineQuery([]));
bot.catch(async (err) => {
if (err) {
if (err.message.match("'sendChatAction' failed!")) {
await err.ctx.leaveChat();
}
const msg =
err.message + `\n<code>${JSON.stringify(err, null, 2)}</code>`;
await log(msg, 'HTML');
Expand Down

0 comments on commit dcae3ad

Please sign in to comment.