Use !suggest <suggestion> to send a dm with suggestions to a specified user. Just fill in recipient_id on line 6 to designate the user who will receive your Discord community's suggestions.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let message = context.params.event.content.split(' ').slice(1).join(' ');
if (context.params.event.content.startsWith('!suggest')) {
await lib.discord.users['@0.1.3'].dms.create({
recipient_id: '', //fill in your discord account id between the ' '
content: `**You received a suggestion!**`,
tts: false,
embed: {
type: 'rich',
title: '',
description: `${message}`,
color: 0x386691, //pick a colour!
author: {
name: `${context.params.event.author.username}#${context.params.event.author.discriminator}`,
icon_url: `https://cdn.discordapp.com/avatars/${context.params.event.author.id}/${context.params.event.author.avatar}.png`,
},
},
});
await lib.discord.channels['@0.1.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: 'Success!',
description: 'Your suggestion was successfully sent to the recepient ',
color: 0x386691, //pick a colour!
},
});
await lib.discord.channels['@0.1.1'].messages.destroy({
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
}
//made by ottolenghi64#0664 <3