Make sure to change environment variables in bottom left of window so that bot run properly. If you find any trouble dm me !! Halcyon#0808 of ping me in support channel
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let message = context.params.event.content;
let mainf = context.params.event.content.split(' ').slice(1).join(' ');
if (message.startsWith(`${process.env.Prefix}feedback`)) {
await lib.discord.channels['@0.1.1'].messages.create({
channel_id:`${process.env.Feedbackchannel}`,
content: ``,
embed: {
type: 'rich',
title: 'Sent a new suggestion:',
description: `${mainf}`,
color: 0x4078c0,
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.1'].messages.destroy({
message_id: context.params.event.id,
channel_id: context.params.event.channel_id
})
await lib.discord.users['@0.1.3'].dms.create({
recipient_id: context.params.event.author.id, // required
content: ``,
embed: {
type: 'rich',
title: 'Your suggestion was:',
description: `${mainf}`,
fields: [{
name: 'Note This',
value: [
`**Hi **<@${context.params.event.author.id}> **Thanks for suggesting us !** \n **Your suggestion is succesfully sent in <#${process.env.Feedbackchannel}>**\n **If you don't find your suggestion in __<#${process.env.Feedbackchannel}>__ please try excuting command again**\n**And if problem still persists DM <@${process.env.BotOwnerId}>** \n ***__Thank you and have a nice day !__***`,
].join('\n')
}],
color: 0x4078c0,
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`
}
}
});
}
//Dm !! Halcyon#0808 for help