Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

200
Visualizações
Telegram bot doesn't send message to one of my groups

I've built a telegram bot using Node.js to send a text message on specific times. So, I have 2 groups: one for testing and other to actually run it. It runs perfectly on testing group but it doesn't respond when it is supposed to run on my actual group. I've got the both chatId from Telegram Web's link. So what can be possibly wrong?

  • Bot is an admin in both groups
  • My account is also an admin, but I'm not the creator of the actual group however what I can do everything in my actual group except adding new admins & remain anonymous.
  • Disabled privacy settings from BotFather

The code

const telegramBot = require("node-telegram-bot-api");
const token = "THE_API_KEY";
const bot = new telegramBot(token, { polling: true });
const cron = require('node-cron');

let chatId = -111111111;
cron.schedule('59 6 15 * * 2', () => {
    bot.sendMessage(chatId, "some string value");
    },{
      scheduled: true,
      timezone: "Etc/UTC"
    });

cron.schedule('59 1 12 * * 7', () => {
  bot.sendMessage(chatId, "some different string value");
  },{
    scheduled: true,
    timezone: "Etc/UTC"
  });
  
  // The part below this comment line works perfectly fine on both groups
  
  bot.on("message", msg => {
  const chatId = msg.chat.id;
  const message = msg.text.trim().toLocaleLowerCase();
  
  switch (message) {
    case "xx":
      bot.sendMessage(chatId, "text");
      break;
    case "xx":
      bot.sendMessage(
        chatId,
        "text"
      );
      break;
    case "#whoareyou":
      bot.sendMessage(
        chatId,
        "text"
      );
      break;
     }
   }); 

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda