Skip to content

Commit

Permalink
add question qotd
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirabellier committed Feb 16, 2024
1 parent d6030d4 commit 31ddf19
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/anime/anime.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -205,7 +205,7 @@ module.exports = {
m.delete();

return message.reply("I didn't find any result");
}
},
);
},
interaction: {
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -436,7 +436,7 @@ module.exports = {
},
() => {
return interaction.reply("I didn't find any result");
}
},
);
},
},
Expand Down
64 changes: 64 additions & 0 deletions src/commands/utility/question.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const Discord = require("discord.js");

module.exports = {
name: "question",
description: "Post a question for QOTD (Support server)",
usage: "<question>",
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,
});
},
},
};

0 comments on commit 31ddf19

Please sign in to comment.