async ({ interaction, client }) => {
if (!interaction.guild) return;
const focusedValue = interaction.options.getFocused();
const group = interaction.options.getSubcommandGroup(true);
const command = interaction.options.getSubcommand(true);
const guild_config = await getGuildConfig(interaction.guild.id)
if (group == 'reset' && command == 'one') {
const key = interaction.options.getString('key', true);
let _options: string[] = [];
switch (key) {
case 'disabled-buttons': _options = guild_config.disabled_buttons; break;
case 'color': _options = guild_config.custom_colours.map(x => x.name); break;
case 'restricted-channels':
let _chans: string[] = [];
for (const channel of guild_config.restricted_channels) {
try {
const _chan = await client.channels.fetch(channel) as TextChannel;
_chans.push(_chan.name);
} catch (error) { }
}
_options = _chans;
break;
}
async ({ interaction, client }) => {
if (!interaction.guild) return;
const focusedValue = interaction.options.getFocused();
const group = interaction.options.getSubcommandGroup(true);
const command = interaction.options.getSubcommand(true);
const guild_config = await getGuildConfig(interaction.guild.id)
if (group == 'reset' && command == 'one') {
const key = interaction.options.getString('key', true);
let _options: string[] = [];
switch (key) {
case 'disabled-buttons': _options = guild_config.disabled_buttons; break;
case 'color': _options = guild_config.custom_colours.map(x => x.name); break;
case 'restricted-channels':
let _chans: string[] = [];
for (const channel of guild_config.restricted_channels) {
try {
const _chan = await client.channels.fetch(channel) as TextChannel;
_chans.push(_chan.name);
} catch (error) { }
}
_options = _chans;
break;
}