Closed bomb-on closed 5 years ago
use callback function to get message's ID
var m_id = '';
// ...
bot.sendMessage({
to: channelID,
message: "pong" // THIS IS THE MESSAGE I'D LIKE TO UPDATE SOMETIMES IN THE FUTURE
}, function (err, res){
// this is inside of callback function
// err => contains potential error
// res => contains message object (response)
// res.id => contains "pong" 's messageID
m_id = res.id
});
now you can use bot.editMessage sometime in the future (you might want to save channelID too tbh)
bot.editMessage({
channelID: channelID,
messageID: m_id,
message: "pongy pong"
})
Thanks a lot!!
Is it possible to edit/update the message sent with
bot.sendMessage()
from the README example?