This snippets shows you everything you have to know about followup & ephemeral messages. Followup messages normal messages that have a little indicator above the message, that shows the Icon of the Command executer and a little text "used /(commandname).
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
//GET THE TOKEN
const token = context.params.event.token;
//CREATE THE FOLLOWUP MESSAGE
let followup = await lib.discord.interactions['@0.0.0'].followups.create({
// Create a Followup message on a interaction
token: token,
content: `This is a followup message.`,
});
const followupID = followup.id; //get the messageID
console.log(followupID);
//EDIT THE FOLLOWUP MESSAGE
let editFollowup = await lib.discord.interactions['@0.0.0'].followups.update({
token: token,
message_id: followupID, //paste followup messageID
content: `This is a also a followup message but edited.`,
});
//GET THE FOLLOWUP MESSAGE
let getFollowup = await lib.discord.interactions['@0.0.0'].followups.retrieve({
token: token,
message_id: followupID,
});
console.log(getFollowup);
//DELETE THE FOLLOWUP MESSAGE
let destroyFollowup = await lib.discord.interactions[
'@0.0.0'
].followups.destroy({
token: token,
message_id: followupID,
});
//CREATE AN EPHEMERAL MESSAGE (ONLY VISABLE FOR ONE PERSON)
let ephemeral = await lib.discord.interactions[
'@0.0.0'
].followups.ephemeral.create({
token: token,
content: 'This is an ephemeral message!',
});