bugfix: missing import

This commit is contained in:
Baipyrus 2024-04-03 19:33:34 +02:00
parent 73fe43a392
commit 4bd3e83add

View File

@ -1,138 +1,139 @@
import { import {
SlashCommandBuilder, SlashCommandBuilder,
PermissionFlagsBits, PermissionFlagsBits,
AutocompleteInteraction, ModalSubmitInteraction,
ChatInputCommandInteraction AutocompleteInteraction,
} from 'discord.js'; ChatInputCommandInteraction
} from 'discord.js';
/** @param {ChatInputCommandInteraction} interaction */
async function createResponse(interaction) {} /** @param {ChatInputCommandInteraction} interaction */
async function createResponse(interaction) {}
/** @param {ChatInputCommandInteraction} interaction */
async function addResponse(interaction) {} /** @param {ChatInputCommandInteraction} interaction */
async function addResponse(interaction) {}
/** @param {ChatInputCommandInteraction} interaction */
async function removeResponse(interaction) {} /** @param {ChatInputCommandInteraction} interaction */
async function removeResponse(interaction) {}
/** @param {ChatInputCommandInteraction} interaction */
async function listResponse(interaction) {} /** @param {ChatInputCommandInteraction} interaction */
async function listResponse(interaction) {}
/** @param {ChatInputCommandInteraction} interaction */
async function infoResponse(interaction) {} /** @param {ChatInputCommandInteraction} interaction */
async function infoResponse(interaction) {}
/** @param {AutocompleteInteraction} interaction */
async function addAutocomplete(interaction) {} /** @param {AutocompleteInteraction} interaction */
async function addAutocomplete(interaction) {}
/** @param {AutocompleteInteraction} interaction */
async function removeAutocomplete(interaction) {} /** @param {AutocompleteInteraction} interaction */
async function removeAutocomplete(interaction) {}
/** @param {AutocompleteInteraction} interaction */
async function infoAutocomplete(interaction) {} /** @param {AutocompleteInteraction} interaction */
async function infoAutocomplete(interaction) {}
export const data = new SlashCommandBuilder()
.setName('response') export const data = new SlashCommandBuilder()
.setDMPermission(false) .setName('response')
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages) .setDMPermission(false)
.setDescription('Event based responses to specific messages with keywords.') .setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages)
.addSubcommand((subcommand) => .setDescription('Event based responses to specific messages with keywords.')
subcommand .addSubcommand((subcommand) =>
.setName('create') subcommand
.setDescription('Creates a new event based response.') .setName('create')
.addStringOption((option) => .setDescription('Creates a new event based response.')
option .addStringOption((option) =>
.setName('keyword') option
.setDescription('The keyword to trigger the response.') .setName('keyword')
.setRequired(true) .setDescription('The keyword to trigger the response.')
) .setRequired(true)
) )
.addSubcommand((subcommand) => )
subcommand .addSubcommand((subcommand) =>
.setName('add') subcommand
.setDescription('Registers a response to a keyword.') .setName('add')
.addStringOption((option) => .setDescription('Registers a response to a keyword.')
option .addStringOption((option) =>
.setName('keyword') option
.setDescription('The keyword to trigger the response.') .setName('keyword')
.setAutocomplete(true) .setDescription('The keyword to trigger the response.')
.setRequired(true) .setAutocomplete(true)
) .setRequired(true)
) )
.addSubcommand((subcommand) => )
subcommand .addSubcommand((subcommand) =>
.setName('remove') subcommand
.setDescription('Unregisters a response to a keyword.') .setName('remove')
.addStringOption((option) => .setDescription('Unregisters a response to a keyword.')
option .addStringOption((option) =>
.setName('type') option
.setDescription('The type of data to be removed.') .setName('type')
.setRequired(true) .setDescription('The type of data to be removed.')
.addChoices( .setRequired(true)
{ name: 'Keyword', value: 'keyword' }, .addChoices(
{ name: 'Response', value: 'response' } { name: 'Keyword', value: 'keyword' },
) { name: 'Response', value: 'response' }
) )
.addStringOption((option) => )
option .addStringOption((option) =>
.setName('name') option
.setDescription('The name of the data to be removed.') .setName('name')
.setAutocomplete(true) .setDescription('The name of the data to be removed.')
.setRequired(true) .setAutocomplete(true)
) .setRequired(true)
) )
.addSubcommand((subcommand) => )
subcommand.setName('list').setDescription('Lists all registered keywords.') .addSubcommand((subcommand) =>
) subcommand.setName('list').setDescription('Lists all registered keywords.')
.addSubcommand((subcommand) => )
subcommand .addSubcommand((subcommand) =>
.setName('info') subcommand
.setDescription('Shows information about a registered keyword.') .setName('info')
.addStringOption((option) => .setDescription('Shows information about a registered keyword.')
option .addStringOption((option) =>
.setName('keyword') option
.setDescription('The keyword to show the details of.') .setName('keyword')
.setAutocomplete(true) .setDescription('The keyword to show the details of.')
.setRequired(true) .setAutocomplete(true)
) .setRequired(true)
); )
/** @param {ModalSubmitInteraction} interaction */ );
export async function modalSubmit(interaction) { /** @param {ModalSubmitInteraction} interaction */
// Only executable in 'add' subcommand export async function modalSubmit(interaction) {
} // Only executable in 'add' subcommand
/** @param {AutocompleteInteraction} interaction */ }
export async function autocomplete(interaction) { /** @param {AutocompleteInteraction} interaction */
const { options } = interaction; export async function autocomplete(interaction) {
const { options } = interaction;
switch (options.getSubcommand()) {
case 'add': switch (options.getSubcommand()) {
addAutocomplete(interaction); case 'add':
break; addAutocomplete(interaction);
case 'remove': break;
removeAutocomplete(interaction); case 'remove':
break; removeAutocomplete(interaction);
case 'info': break;
infoAutocomplete(interaction); case 'info':
break; infoAutocomplete(interaction);
} break;
} }
/** @param {ChatInputCommandInteraction} interaction */ }
export async function execute(interaction) { /** @param {ChatInputCommandInteraction} interaction */
const { options } = interaction; export async function execute(interaction) {
const { options } = interaction;
switch (options.getSubcommand()) {
case 'create': switch (options.getSubcommand()) {
createResponse(interaction); case 'create':
break; createResponse(interaction);
case 'add': break;
addResponse(interaction); case 'add':
break; addResponse(interaction);
case 'remove': break;
removeResponse(interaction); case 'remove':
break; removeResponse(interaction);
case 'list': break;
listResponse(interaction); case 'list':
break; listResponse(interaction);
case 'info': break;
infoResponse(interaction); case 'info':
break; infoResponse(interaction);
} break;
} }
}