From ec0cab20514f8787bec9dcdb595ee222e0e91181 Mon Sep 17 00:00:00 2001 From: Forichok Date: Fri, 8 Jan 2021 17:41:23 +0300 Subject: [PATCH] add /language@banofbot to stop list --- src/bot.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bot.ts b/src/bot.ts index 674e51f..9f675c3 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -41,7 +41,8 @@ async function handleMessage(ctx: TelegrafContext, isAdmin: Boolean) { if (!isAdmin) { const hasUrl = Boolean(env.DENY_URL || 'true') && containsUrl(msg.text); const tooLong = msg.text.length > Number(env.MAX_MSG_LENGTH || '1000'); - if (hasUrl || tooLong) { + const hasIllegalText = msg.text.indexOf('/language@banofbot') != -1; + if (hasUrl || tooLong || hasIllegalText) { ctx.deleteMessage(msg.message_id); await updateUser(msg.from, msg.chat, { hasViolation: true }); return;