With this command you can have a lot of fun by suggesting anything you want! just to set up go to your Environment Variables and make up 2 Variables one named PREFIX and add in your custom prefix! The other named SUGGESTIONCHANNEL and add the ID of the channel you want the suggestions to appear in!\nEnjoy this code Happy hacking Ronan Films
// A simple suggestion command!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let event = context.params.event
if (event.content.startsWith(`${process.env.PREFIX}suggest`)) {
let user = await lib.discord.users['@0.0.6'].retrieve({
user_id: event.author.id,
});
let text = event.content.split(` `);
let suggestion = text.slice(1).join(` `);
if (!suggestion) {
await lib.discord.channels['@0.1.0'].messages.create({
channel_id: event.channel_id,
content: `What suggestion do you want to make?`,
});
} else {
await lib.discord.channels['@0.1.0'].messages.destroy({
channel_id: event.channel_id,
message_id: event.id,
});
let suggest = await lib.discord.channels['@0.1.0'].messages.create({
channel_id: `${process.env.SUGGESTIONCHANNEL}`,
content: ``,
embed: {
title: `${user.username} suggested:`,
type: 'rich',
color: 0x00aa00,
description: suggestion,
},
});
await lib.discord.channels['@0.1.0'].messages.reactions.create({
emoji: 'π', // required
message_id: suggest.id, // required
channel_id: `${process.env.SUGGESTIONCHANNEL}`, // required
});
await lib.discord.channels['@0.1.0'].messages.reactions.create({
emoji: 'π', // required
message_id: suggest.id, // required
channel_id: `${process.env.SUGGESTIONCHANNEL}`, // required
});
}
}