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)
26 lines • 879 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const discord_js_1 = require("discord.js");
const name = 'clear';
exports.default = {
params: {
autoRemove: true,
},
registerCommand: () => {
return new discord_js_1.SlashCommandBuilder()
.setName(name)
.setDescription('Delete messages')
.setDMPermission(false)
.addIntegerOption((option) => option
.setName('input')
.setDescription('Number of last messages to delete')
.setRequired(false));
},
executeCommand: async (param, interaction) => {
const channel = interaction.channel;
const nb = param > 0 && param <= 100 ? param : 100;
await channel.bulkDelete(nb).catch((e) => console.log(e));
return 'Done!';
},
};
//# sourceMappingURL=clear.js.map