1
Hello, I’m doing a service to warn me of possible errors that may occur on my server,my doubt is , after I send the message how I finish the execution or the way this presenting in the image below is normal ? For to finish the task I have to give a Ctrl + c
code:
var util = require('util');
var TelegramBot = require('node-telegram-bot-api');
var token = '237907874:AAG8hK1lPWi1WRlqQT2';
var bot = new TelegramBot(token, {polling: true});
var millisecondsToWait = 5000;
robot = {
"alert" : function teste(message) {
var toId = '-103822200';
var resp = util.format('Alerta: %s', message);
bot.sendMessage(toId, resp);
}
}
robot.alert(process.argv[2]);
cmd executed as follows
node.exe bot.js 'texto que quero enviar'
have already used the codes , Exit() , exitprocess() , close() - Unsuccessful
Consider adding a brief explanation to enrich the answer.
– Marcell Alves