From b466dacf999a0cdb081c7f2ef54102565cc8d691 Mon Sep 17 00:00:00 2001 From: baz Date: Thu, 16 Nov 2023 23:32:16 +0000 Subject: [PATCH] Create main file --- index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..e0803c4 --- /dev/null +++ b/index.js @@ -0,0 +1,15 @@ +// Require the necessary discord.js classes +const { Client, Events, GatewayIntentBits } = require('discord.js'); +const { token } = require('./config.json'); + +// Create a new client instance +const client = new Client({ intents: [GatewayIntentBits.Guilds] }); + +// When the client is ready, run this code (only once) +// We use 'c' for the event parameter to keep it separate from the already defined 'client' +client.once(Events.ClientReady, c => { + console.log(`Ready! Logged in as ${c.user.tag}`); +}); + +// Log in to Discord with your client's token +client.login(token); \ No newline at end of file