Answers for "how to make a discord js bot get its own message id"

0

how to make a discord js bot get its own message id

// with async/await:
async function replyAndLog() {
  let sent = await message.reply("Your stuff..."); // this returns the message you just sent
  let id = sent.id; // you can get its ID with <Message>.id, as usually
  console.log(id);
}

// with <Promise>.then():
message.reply("Your stuff").then(sent => { // 'sent' is that message you just sent
  let id = sent.id;
  console.log(id);
});
Posted by: Guest on October-28-2021

Code answers related to "how to make a discord js bot get its own message id"

Code answers related to "Javascript"

Browse Popular Code Answers by Language