n8n-nodes-discord
Version:
nodes to trigger workflows from Discord or send interactive messages. Uses the components API which allows to create dialogs (e.g. attach buttons and wait for the user to click on them)
16 lines • 630 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const { Routes } = require('discord.js');
const { REST } = require('@discordjs/rest');
function default_1(token, clientId, commands) {
const rest = new REST({ version: '10' }).setToken(token);
const parsedCommands = commands.map((e) => e.command().toJSON());
rest
.put(Routes.applicationCommands(clientId), {
body: parsedCommands,
})
.then(() => console.log('Successfully registered application commands.'))
.catch(console.error);
}
exports.default = default_1;
//# sourceMappingURL=deploy-commands.js.map