Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions SuggestCommandPlugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Suggestion Command
This plugin lets you make suggestion command.

## Setup
* Copy the contents of the `suggest.ts` file into a new file with this path in your bot: `src/commands/information/suggestion.ts`.
* Update line 27 with the ID of your channel and make `suggest.ts` file inside `src/commands/information`.
* You can delete the line 47 if you doesn't want to add Threads.

* If you found some bug let me know it.

Aurora_Jack#5330
66 changes: 66 additions & 0 deletions SuggestCommandPlugin/suggest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { CommandContext } from '../../structures/addons/CommandAddons';
import { Command } from '../../structures/Command';
import { TextChannel } from 'discord.js';
import { checkIconUrl, greenColor, mainColor } from '../../handlers/locale';
import { discordClient } from '../../main';

class SuggestionCommand extends Command {
constructor() {
super({
trigger: "suggest",
description: "Suggest a suggestion.",
type: "ChatInput",
module: "utilities",
args: [
{
trigger: 'suggestion',
description: 'Say here what you wanna suggest.',
isLegacyFlag: false,
required: true,
type: 'String',
}
]
});
}

async run(ctx: CommandContext) {
const channel = await discordClient.channels.fetch('YOUR SUGGESTION CHANNEL') as TextChannel;
channel.send({
embeds: [
{
author: {
name: 'Suggestion',
},
description: (ctx.args['suggestion']),
color: mainColor,
timestamp: new Date(),
footer: {
text: `Suggested by: ${ctx.user.tag}`,
iconURL: ctx.user.displayAvatarURL({dynamic: true})
},
}
]
}).then(sentMessage => {
sentMessage
.react('👍')
.react('🤷')
.react('👎')
.startThread({ name: 'Suggestion', autoArchiveDuration: 1440, reason: 'Because someone send a suggestion.' })
}).catch(console.error);

return ctx.reply({
embeds: [
{
author: {
name: 'Success!',
iconURL: checkIconUrl,
},
description: 'Your suggestion has been sent successfully!',
color: greenColor,
}
]
})
}
}

export default SuggestionCommand;