Ever made any mistake and want to confess it without letting others know that it was you? Then you are at the right place. Go to omg.ac/command and register a slash command named 'confess' with a string option as 'message'
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
// register the initial slash command response
await lib.discord.interactions['@1.0.1'].responses.create({
token: `${context.params.event.token}`,
response_type: 'DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE',
});
// send the confession
await lib.discord.interactions['@1.0.1'].followups.create({
token: `${context.params.event.token}`,
content: ` `,
embed: [
{
type: `rich`,
title: `New Confession`,
description: `${context.params.event.data.options[0].value}`,
timestamp: new Date().toISOString(),
color: 0x00ff00,
},
],
});
// send a msg which is visible only to the user
await lib.discord.interactions['@1.0.1'].followups.ephemeral.create({
token: `${context.params.event.token}`,
content: `Confession sent `,
});
// now dm the user
await lib.discord.users['@0.2.1'].dms.create({
recipient_id: `${context.params.event.member.user.id}`,
content: `Dont worry my friend . To err is human, but the bigger thing is you admitted it before all. \n\nI'll never let the people know that it was you π`,
});