Technical Help with Javascript
Budget: $10 – $30 USD
I am trying to automate sending a message through web.telegram.org to a bot i am using, i would like to send the message in a set time periodically, as its a server status ping.
i could not find a better way than this
---------------
//send message the chats with thirugram.js
//open up telegram web and go to the chat you want to send the message to
//open console ( Ctrl + Shift + J )
//execute the code
var message = ""; //required message
var interval = 1 ; // in seconds
var count = 10 ; //number of times to send
var notifyInterval = 5 ; //notify
var i = 0 ;
var timer = setInterval(function(){
document.getElementsByClassName('composer_rich_textarea')[0].innerHTML = message;
$('.im_submit').trigger('mousedown');
i++;
if( i == count )
clearInterval(timer);
if( i % notifyInterval == 0)
console.log(i + ' MESSAGES SENT');
} , interval * 1000 ) ;
----------------
but it is not working and producing the following error
VM576:7 Uncaught TypeError: Cannot set properties of undefined (setting 'innerHTML')
at <anonymous>:7:73
(anonymous) @ VM576:7
setInterval (async)
(anonymous) @ VM576:6
i could not find a better way than this
---------------
//send message the chats with thirugram.js
//open up telegram web and go to the chat you want to send the message to
//open console ( Ctrl + Shift + J )
//execute the code
var message = ""; //required message
var interval = 1 ; // in seconds
var count = 10 ; //number of times to send
var notifyInterval = 5 ; //notify
var i = 0 ;
var timer = setInterval(function(){
document.getElementsByClassName('composer_rich_textarea')[0].innerHTML = message;
$('.im_submit').trigger('mousedown');
i++;
if( i == count )
clearInterval(timer);
if( i % notifyInterval == 0)
console.log(i + ' MESSAGES SENT');
} , interval * 1000 ) ;
----------------
but it is not working and producing the following error
VM576:7 Uncaught TypeError: Cannot set properties of undefined (setting 'innerHTML')
at <anonymous>:7:73
(anonymous) @ VM576:7
setInterval (async)
(anonymous) @ VM576:6