Skip to content

Commit

Permalink
add /language@banofbot to stop list
Browse files Browse the repository at this point in the history
  • Loading branch information
Forichok committed Jan 8, 2021
1 parent d684f74 commit ec0cab2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ec0cab2

Please sign in to comment.