Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: replace function javascript recurrent 
Javascript :: useEffect es6 format 
Javascript :: Error: ENOENT: no such file or directory, scandir 
Javascript :: bootstrap modal show on page load without jquery 
Javascript :: createPortal usage 
Javascript :: javascript array same class elements 
Javascript :: how to reaload a tab in js 
Javascript :: nuxt two props 
Javascript :: react-hook-form input 
Javascript :: Getting the type of a control using Javascript 
Javascript :: how to ask for leave in js 
Javascript :: react input mask ref 
Javascript :: script.js:15 Uncaught ReferenceError: d3 is not defined at script.js 
Javascript :: js chai setup 
Javascript :: how to load a javascript game from react 
Javascript :: javascript copy input value to clipboard on click 
Javascript :: javascript cast everything to string 
Javascript :: go to line in webstorm 
Javascript :: Cycle through elements with the same tag 
Javascript :: manifest.json background service worker vs scripts 
Javascript :: concatenation mathematics notation 
Javascript :: add codegrepper 
Javascript :: mongoose search by keywords 
Javascript :: google distance value to km convert 
Javascript :: Replacing Specific word from url, replacing url 
Javascript :: react router 6 redirect 
Javascript :: mongoose schema aggregation lookup multiple collections 
Javascript :: "create a chatbot using javascript only" 
Javascript :: reactRender 
Javascript :: clone copy a table in servicenow 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =