blob: c7269c70fa8f92b1048b31bf3963f0050ad2ec4f [file] [log] [blame]
pineafan32767212022-03-14 21:27:39 +00001import { CommandInteraction, MessageEmbed, MessageSelectMenu } from "discord.js";
2import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
3import { WrappedCheck } from "jshaiku";
4import readConfig from "../../utils/readConfig.js";
5import { toHexArray, toHexInteger, logs } from "../../utils/calculate.js"
6import { capitalize } from "../../utils/generateKeyValueList.js";
7
8const command = (builder: SlashCommandSubcommandBuilder) =>
9 builder
10 .setName("menu")
11 .setDescription("Shows a full UI of all settings")
12
13const callback = async (interaction: CommandInteraction) => {
14 return
15 let config = await readConfig(interaction.guild.id);
16
17 let currentValues = toHexArray(config.logging.log.toLog);
18
19 let toLogDropdownOptions = []
20
21 for(let i of logs) {
22 if(currentValues.includes(i)) {
23 toLogDropdownOptions.push({
24 name: capitalize(i),
25 value: i,
26 emoji: "TICK"
27 })
28 } else {
29 toLogDropdownOptions.push({
30 label: capitalize(i),
31 value: i,
32 emoji: "CROSS"
33 })
34 }
35 }
36
37 let toLogDropdown = new MessageSelectMenu()
38 .setCustomId("tolog")
39 .setMaxValues(22)
40 .addOptions()
41
42 let embed = new MessageEmbed()
43
44 interaction.reply("Command incomplete [settings/all]");
45}
46
47const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
48 return true;
49}
50
51export { command };
52export { callback };
53export { check };