From 3ce005888c97b5992188de8b6d9ae2f4096cf621 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sat, 26 Feb 2022 15:02:06 +0900 Subject: [PATCH 01/13] Suggestion Command --- Suggestion Command | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Suggestion Command diff --git a/Suggestion Command b/Suggestion Command new file mode 100644 index 0000000..bca922b --- /dev/null +++ b/Suggestion Command @@ -0,0 +1,60 @@ +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('886587818049171487') 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}) + }, + } + ] + }); + + return ctx.reply({ + embeds: [ + { + author: { + name: 'Success!', + iconURL: checkIconUrl, + }, + description: 'You Successfully suggested a suggestion.', + color: greenColor, + } + ] + }) + } +} + +export default SuggestionCommand; From a021d0682cbffdcea3cd4dba02099a3d9839e24f Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sat, 26 Feb 2022 15:43:19 +0900 Subject: [PATCH 02/13] Create suggest.ts --- SuggestCommandPlugin/suggest.ts | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 SuggestCommandPlugin/suggest.ts diff --git a/SuggestCommandPlugin/suggest.ts b/SuggestCommandPlugin/suggest.ts new file mode 100644 index 0000000..bca922b --- /dev/null +++ b/SuggestCommandPlugin/suggest.ts @@ -0,0 +1,60 @@ +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('886587818049171487') 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}) + }, + } + ] + }); + + return ctx.reply({ + embeds: [ + { + author: { + name: 'Success!', + iconURL: checkIconUrl, + }, + description: 'You Successfully suggested a suggestion.', + color: greenColor, + } + ] + }) + } +} + +export default SuggestionCommand; From c0d8640622e852259944807fd60ddc4efc959ca4 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sat, 26 Feb 2022 15:53:16 +0900 Subject: [PATCH 03/13] Create README.md --- SuggestCommandPlugin/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 SuggestCommandPlugin/README.md diff --git a/SuggestCommandPlugin/README.md b/SuggestCommandPlugin/README.md new file mode 100644 index 0000000..d74f1a2 --- /dev/null +++ b/SuggestCommandPlugin/README.md @@ -0,0 +1,10 @@ +# 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/session.ts`. +* Update line 27 with the ID of your channel and make `suggest.ts` file inside `src/commands/information`. + +* If you found some bug let me know it. + +Aurora_Jack#5330 From 926178ad46634e4234998e8e9d5150cb720d11e6 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sat, 26 Feb 2022 15:57:51 +0900 Subject: [PATCH 04/13] Delete Suggestion Command --- Suggestion Command | 60 ---------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 Suggestion Command diff --git a/Suggestion Command b/Suggestion Command deleted file mode 100644 index bca922b..0000000 --- a/Suggestion Command +++ /dev/null @@ -1,60 +0,0 @@ -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('886587818049171487') 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}) - }, - } - ] - }); - - return ctx.reply({ - embeds: [ - { - author: { - name: 'Success!', - iconURL: checkIconUrl, - }, - description: 'You Successfully suggested a suggestion.', - color: greenColor, - } - ] - }) - } -} - -export default SuggestionCommand; From 5e7c1eb2aa737b8db32a12f18d250a3a02c2b612 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sat, 26 Feb 2022 15:59:07 +0900 Subject: [PATCH 05/13] Fix something --- SuggestCommandPlugin/suggest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SuggestCommandPlugin/suggest.ts b/SuggestCommandPlugin/suggest.ts index bca922b..7258017 100644 --- a/SuggestCommandPlugin/suggest.ts +++ b/SuggestCommandPlugin/suggest.ts @@ -24,7 +24,7 @@ class SuggestionCommand extends Command { } async run(ctx: CommandContext) { - const channel = await discordClient.channels.fetch('886587818049171487') as TextChannel; + const channel = await discordClient.channels.fetch('YOUR SUGGESTION CHANNEL') as TextChannel; channel.send({ embeds: [ { From 6b1158a700b2a345590e8b93403137ff5f07b550 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sat, 26 Feb 2022 16:00:30 +0900 Subject: [PATCH 06/13] Update README.md --- SuggestCommandPlugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SuggestCommandPlugin/README.md b/SuggestCommandPlugin/README.md index d74f1a2..b251dbd 100644 --- a/SuggestCommandPlugin/README.md +++ b/SuggestCommandPlugin/README.md @@ -2,7 +2,7 @@ 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/session.ts`. +* 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`. * If you found some bug let me know it. From 1b2f6d8290c75868bedd111ead575ff18b3a89d2 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 27 Feb 2022 13:51:51 +0900 Subject: [PATCH 07/13] Added emoji reaction and thread --- SuggestCommandPlugin/suggest.ts | 45 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/SuggestCommandPlugin/suggest.ts b/SuggestCommandPlugin/suggest.ts index 7258017..b047ae1 100644 --- a/SuggestCommandPlugin/suggest.ts +++ b/SuggestCommandPlugin/suggest.ts @@ -24,23 +24,28 @@ class SuggestionCommand extends Command { } async run(ctx: CommandContext) { - const channel = await discordClient.channels.fetch('YOUR SUGGESTION CHANNEL') as TextChannel; + const channel = await discordClient.channels.fetch('886587818049171487') 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}) - }, - } - ] - }); + 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('👍') + sentMessage.react('🤷') + sentMessage.react('👎') + sentMessage.startThread({ name: 'Suggestion', autoArchiveDuration: 1440, reason: 'Because someone send a suggestion.' }) + }).catch(console.error); return ctx.reply({ embeds: [ @@ -52,9 +57,9 @@ class SuggestionCommand extends Command { description: 'You Successfully suggested a suggestion.', color: greenColor, } - ] - }) - } -} + ] + }) + } + } export default SuggestionCommand; From 6d708b33e3479b1c52009390592e9931d04c3192 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 27 Feb 2022 13:52:02 +0900 Subject: [PATCH 08/13] Update README.md --- SuggestCommandPlugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SuggestCommandPlugin/README.md b/SuggestCommandPlugin/README.md index b251dbd..747c0da 100644 --- a/SuggestCommandPlugin/README.md +++ b/SuggestCommandPlugin/README.md @@ -4,7 +4,7 @@ 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 From 9f5e280cb44c273c6d889366c77d578c55808f58 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 27 Feb 2022 13:52:13 +0900 Subject: [PATCH 09/13] Added emoji reaction and thread From bb46dcb7f14e0600ab1fe9f9d523f48604533a45 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 27 Feb 2022 13:52:50 +0900 Subject: [PATCH 10/13] Update README.md --- SuggestCommandPlugin/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SuggestCommandPlugin/README.md b/SuggestCommandPlugin/README.md index 747c0da..6b3d3f0 100644 --- a/SuggestCommandPlugin/README.md +++ b/SuggestCommandPlugin/README.md @@ -5,6 +5,7 @@ This plugin lets you make suggestion command. * 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 From 04086339e6e6650a35b57787213c81603155e89b Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 27 Feb 2022 13:53:45 +0900 Subject: [PATCH 11/13] Update suggest.ts --- SuggestCommandPlugin/suggest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SuggestCommandPlugin/suggest.ts b/SuggestCommandPlugin/suggest.ts index b047ae1..7aa58b0 100644 --- a/SuggestCommandPlugin/suggest.ts +++ b/SuggestCommandPlugin/suggest.ts @@ -24,7 +24,7 @@ class SuggestionCommand extends Command { } async run(ctx: CommandContext) { - const channel = await discordClient.channels.fetch('886587818049171487') as TextChannel; + const channel = await discordClient.channels.fetch('YOUR SUGGESTION CHANNEL') as TextChannel; channel.send({ embeds: [ { From e8500dae773033def875c8a98dbb5e3660afbf04 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 27 Feb 2022 14:11:08 +0900 Subject: [PATCH 12/13] Update suggest.ts --- SuggestCommandPlugin/suggest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SuggestCommandPlugin/suggest.ts b/SuggestCommandPlugin/suggest.ts index 7aa58b0..c4360f2 100644 --- a/SuggestCommandPlugin/suggest.ts +++ b/SuggestCommandPlugin/suggest.ts @@ -54,7 +54,7 @@ class SuggestionCommand extends Command { name: 'Success!', iconURL: checkIconUrl, }, - description: 'You Successfully suggested a suggestion.', + description: 'Your suggestion has been sent successfully!', color: greenColor, } ] From 0b1878e3b809d28b0279c168d3b2a1ba56406e54 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:13:28 +0900 Subject: [PATCH 13/13] Update suggest.ts --- SuggestCommandPlugin/suggest.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SuggestCommandPlugin/suggest.ts b/SuggestCommandPlugin/suggest.ts index c4360f2..b5de1cd 100644 --- a/SuggestCommandPlugin/suggest.ts +++ b/SuggestCommandPlugin/suggest.ts @@ -41,10 +41,11 @@ class SuggestionCommand extends Command { } ] }).then(sentMessage => { - sentMessage.react('👍') - sentMessage.react('🤷') - sentMessage.react('👎') - sentMessage.startThread({ name: 'Suggestion', autoArchiveDuration: 1440, reason: 'Because someone send a suggestion.' }) + sentMessage + .react('👍') + .react('🤷') + .react('👎') + .startThread({ name: 'Suggestion', autoArchiveDuration: 1440, reason: 'Because someone send a suggestion.' }) }).catch(console.error); return ctx.reply({