Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

102
Views
Antispam thtottler

I am working on creating a telegram bot, I want to make an anti-spam system, that is, when a person presses a button too many times, the bot will freeze for him for a certain number of seconds, it is possible to write a message about blocking. People in other matters do not help me.

import {
    bot
} from '../token.js';

import {
    keyboardMain
} from '../keyboards/keyboardsMain.js';

export function commands() {
    bot.on('message', msg => {
        const text = msg.text;
        const chatId = msg.chat.id;

        if (text === '/start') {
           return bot.sendMessage(chatId, 'hello', keyboardMain);
        }

        return bot.sendMessage(chatId, 'error');
    });
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Do you use telegraf as telegram module ? If yes, you can kick users from channels or groups.

about 4 years ago · Juan Pablo Isaza Report

0

here is a little piece that i made for you :) you can apply it to anything ^_^

var tps = 0;
var allowpassage = false;
var detectspamon = document;
c = function() {
    setTimeout(()=>{
        console.log("got clicks:",tps);
        if (tps==0) {console.log("no clicking detected");}
        else if (tps==1) {console.log("success");allowpassage=true;}
        else {console.log("too many clicks per second");}
        tps=0;
        console.log("setting clicks to 0");
    },500);
}

detectspamon.onclick = () => {tps++;console.log(tps);c(tps);}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!