do not create interaction commands with options.default

This commit is contained in:
Cynthia Foxwell 2024-05-17 14:41:58 -06:00
parent 4f8340cba7
commit d55a28149a

View file

@ -191,11 +191,16 @@ bot.once("ready", async () => {
const hasCommand = commands.find((c) => c.name == command.name); const hasCommand = commands.find((c) => c.name == command.name);
if (hasCommand) continue; if (hasCommand) continue;
const options = Object.values(command.options);
for (const option of options) {
delete option.default;
}
await bot.createCommand({ await bot.createCommand({
name: command.name, name: command.name,
type: command.type, type: command.type,
description: command.helpText, description: command.helpText,
options: Object.values(command.options), options: options,
defaultMemberPermissions: command.permissions, defaultMemberPermissions: command.permissions,
dmPermission: !command.guildOnly, dmPermission: !command.guildOnly,
}); });