diff --git a/src/commands/anime/anime.js b/src/commands/anime/anime.js index 7cba3e6..ac19bb5 100644 --- a/src/commands/anime/anime.js +++ b/src/commands/anime/anime.js @@ -137,7 +137,7 @@ module.exports = { for (const manga of mangas) { const startDate = moment(manga.published.from).format( - "MMMM Do YYYY" + "MMMM Do YYYY", ); const endDate = moment(manga.published.to).format("MMMM Do YYYY"); @@ -205,7 +205,7 @@ module.exports = { m.delete(); return message.reply("I didn't find any result"); - } + }, ); }, interaction: { @@ -373,7 +373,7 @@ module.exports = { for (const manga of mangas) { const startDate = moment(manga.published.from).format( - "MMMM Do YYYY" + "MMMM Do YYYY", ); const endDate = moment(manga.published.to).format("MMMM Do YYYY"); @@ -436,7 +436,7 @@ module.exports = { }, () => { return interaction.reply("I didn't find any result"); - } + }, ); }, }, diff --git a/src/commands/utility/question.js b/src/commands/utility/question.js new file mode 100644 index 0000000..f521fd3 --- /dev/null +++ b/src/commands/utility/question.js @@ -0,0 +1,64 @@ +const Discord = require("discord.js"); + +module.exports = { + name: "question", + description: "Post a question for QOTD (Support server)", + usage: "", + run: () => { + return; + }, + interaction: { + data: { + name: "question", + type: 1, + description: "Post your question for QOTD", + options: [ + { + name: "submit", + type: 1, + description: "Submit a question", + options: [ + { + name: "question", + type: 3, + description: "Your question", + required: true, + }, + ], + }, + ], + }, + run: async (client, interaction) => { + const guild = await client.guilds.fetch("864537979339014184"); + + if (interaction.guildId !== guild) { + interaction.reply({ + content: "You must join the support server first!", + ephemeral: true, + }); + + return; + } + + const question = interaction.options.getString("question"); + const channel = await client.channels.fetch("969402082434121798"); + const user = interaction.user.username; + + const embed = new Discord.EmbedBuilder() + .setAuthor({ + name: user, + iconURL: interaction.user.displayAvatarURL(), + }) + .setDescription(question) + .setColor("Blue") + .setFooter({ text: "New QOTD Submission!" }); + + channel.send({ embeds: [embed] }); + + interaction.reply({ + content: `Your question has been submitted! | ${question}`, + ephemeral: true, + }); + }, + }, +};