-
Notifications
You must be signed in to change notification settings - Fork 5
/
yesno.ts
33 lines (26 loc) · 1.03 KB
/
yesno.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { GuildMember, SlashCommandStringOption } from "discord.js";
import { SlashCommand } from "../../models/commands/SlashCommand";
import { YesNoReplies } from "../../responses/text/YesNoReplies";
import { CommandCategory } from "../../struct/commands/CommandCategory";
const yesno = new SlashCommand()
.setName("yesno")
.setDescription("Yes or no? I can help you decide!")
.setCategory(CommandCategory.Fun)
.setHelp({
syntax: "/yesno `option`",
example: "/yesno `axer cringe?`",
})
.addOptions(
new SlashCommandStringOption()
.setName("question")
.setDescription("Type your question here!")
.setRequired(true)
);
yesno.setExecutable(async (command) => {
const question = command.options.getString("question", true);
const phrases = YesNoReplies;
if (!(command.member instanceof GuildMember)) return;
const res = `> ${question}\n${phrases[Math.floor(Math.random() * phrases.length)]}`;
command.editReply(res);
});
export { yesno };