This slash command is an example for suggesting an idea and posting it in the suggestion channel... Remember to change "CHANNEL_ID" with your Suggestion Channel's ID and "EMOJI_ID" with your Custom Emoji ID. Register your slash command with Discord here: https://autocode.com/tools/discord/command-builder/
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let suggestion = context.params.event.data.options[0].value
let message = await lib.discord.channels['@0.1.1'].messages.create({
"channel_id": `CHANNEL_ID`,
"content": "",
"tts": false,
"embed": {
"type": "rich",
"title": "New Suggestion!",
"description": "",
"color": 0x73ff00,
"fields": [
{
"name": "Suggested by:",
"value": `${context.params.event.member.user.username}#${context.params.event.member.user.discriminator}`
},
{
"name": "Suggestion:",
"value": `${suggestion}`
}
]
}
});
await lib.discord.channels['@0.1.1'].messages.reactions.create({
emoji: `EMOJI_ID`,
message_id: `${message.id}`,
channel_id: `CHANNEL_ID`
});
await lib.discord.channels['@0.1.1'].messages.reactions.create({
emoji: `EMOJI_ID`,
message_id: `${message.id}`,
channel_id: `CHANNEL_ID`
});