blob: be3cb8a76eb1df14963a1df9287be6b451e201da (
plain)
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
|
import { SlashCommandBuilder } from "discord.js";
import createTicket from "../utilities/createTicket.js";
import notifyRoleByName from "../utilities/notifyRoleByName.js";
export default {
data: new SlashCommandBuilder()
.setName("requisition")
.setDescription(
"Request items from the quartermaster. A new requisition ticket will be created.",
)
.addStringOption((option) =>
option
.setName("contents")
.setDescription("What are you requesting? Be as specific as possible.")
.setRequired(true),
),
execute: async (interaction) => {
const contents = interaction.options.getString("contents");
const ticket = await createTicket(interaction, ["quartermaster"]);
await ticket.send({
content: `**New requisition request from <@${interaction.user.id}>**: ${contents}`,
});
// reply to the user
await interaction.reply({
content: `Your requisition ticket has been created: <#${ticket.id}>`,
ephemeral: true,
});
},
};
|