n8n-nodes-discord-dnd
Version:
n8n node to create triggers for Discord events
22 lines • 801 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.initializeDiscordClient = void 0;
const discord_js_1 = require("discord.js");
/**
* Initializes the Discord client, sets up events, and logs in
* @param token Bot token for authentication
* @param intents Array of GatewayIntentBits for the client
* @throws Error if no token is provided
* @returns Discord client instance
*/
const initializeDiscordClient = async (token, clientOptions) => {
if (!token) {
throw new Error("No bot token provided in credentials!");
}
const client = new discord_js_1.Client(clientOptions);
// Login to Discord
await client.login(token);
return client;
};
exports.initializeDiscordClient = initializeDiscordClient;
//# sourceMappingURL=client.js.map
;