Skip to content

Commit

Permalink
fix: Fix default handler triggering on other events in non-personal c…
Browse files Browse the repository at this point in the history
…hats
  • Loading branch information
devadathanmb committed Jan 22, 2024
1 parent f495992 commit 1f782cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/handlers/defaultHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import deleteMessage from "../utils/deleteMessage";
/* const randomQuotes = require("random-quotes"); */

async function defaultHandler(ctx: CustomContext) {
// Events like adding, removing memebers from groups are considered as messages
// For groups, only direct messages are considered
// Bot permission "can delete messages" should be unset for this to work
if (ctx.message!.chat.type !== "private" && !("text" in ctx.message!)) return;

// I could'nt find a better way to do this
if ("text" in ctx.message!) {
if (
Expand Down

0 comments on commit 1f782cc

Please sign in to comment.