blob: 5f7c7deb613b8ec23c2818aef0430c5fdf671978 [file] [log] [blame]
pineafan377794f2022-04-18 19:01:01 +01001import { CategoryChannel, CommandInteraction } from "discord.js";
pineafan4f164f32022-02-26 22:07:12 +00002import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
3import { WrappedCheck } from "jshaiku";
4
5const command = (builder: SlashCommandSubcommandBuilder) =>
6 builder
7 .setName("viewas")
8 .setDescription("View the server as a specific member")
pineafan377794f2022-04-18 19:01:01 +01009 .addUserOption(option => option.setName("member").setDescription("The member to view as").setRequired(true))
pineafan4f164f32022-02-26 22:07:12 +000010
11const callback = (interaction: CommandInteraction) => {
pineafan377794f2022-04-18 19:01:01 +010012 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)
pineafan4f164f32022-02-26 22:07:12 +000016}
17
18const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
19 return true;
20}
21
pineafan8b4b17f2022-02-27 20:42:52 +000022export { command, callback, check };