pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 1 | import { CategoryChannel, CommandInteraction } from "discord.js"; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 2 | import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; |
| 3 | import { WrappedCheck } from "jshaiku"; |
| 4 | |
| 5 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 6 | builder |
| 7 | .setName("viewas") |
| 8 | .setDescription("View the server as a specific member") |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 9 | .addUserOption(option => option.setName("member").setDescription("The member to view as").setRequired(true)) |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 10 | |
| 11 | const callback = (interaction: CommandInteraction) => { |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 12 | let channels = interaction.guild.channels.cache |
| 13 | .filter(c => c.type === "GUILD_CATEGORY") |
| 14 | .map(c => (c as CategoryChannel).children.map(c => c)) |
| 15 | console.log(channels) |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => { |
| 19 | return true; |
| 20 | } |
| 21 | |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 22 | export { command, callback, check }; |