patchInteractions = async () => { const { REST, Routes } = require("discord.js"); this.Logger.info("Patching app."); const rest = new REST().setToken(process.env.TOKEN); let commandsToRegister = []; this.slashCommands .map((/** @type {import('../structures/Command')} */ command) => ({ name: command.name, description: command.description, type: ApplicationCommandType.ChatInput, options: command.slashCommand.options, default_member_permissions: command.defaultUserPermissions.length > 0 ? PermissionsBitField.resolve(command.defaultUserPermissions).toString() : null, })) .forEach((command) => commandsToRegister.push(command)); console.log(commandsToRegister); try { await rest.put(Routes.applicationCommands(this.user.id), { body: commandsToRegister }); this.Logger.success("Patch complete."); } catch (error) { this.Logger.error("patch error", error); }