Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

103
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda