pineafan | 3276721 | 2022-03-14 21:27:39 +0000 | [diff] [blame^] | 1 | import { CommandInteraction, MessageEmbed, MessageSelectMenu } from "discord.js"; |
| 2 | import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; |
| 3 | import { WrappedCheck } from "jshaiku"; |
| 4 | import readConfig from "../../utils/readConfig.js"; |
| 5 | import { toHexArray, toHexInteger, logs } from "../../utils/calculate.js" |
| 6 | import { capitalize } from "../../utils/generateKeyValueList.js"; |
| 7 | |
| 8 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 9 | builder |
| 10 | .setName("menu") |
| 11 | .setDescription("Shows a full UI of all settings") |
| 12 | |
| 13 | const 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 | |
| 47 | const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => { |
| 48 | return true; |
| 49 | } |
| 50 | |
| 51 | export { command }; |
| 52 | export { callback }; |
| 53 | export { check }; |