diff --git a/package.json b/package.json index 6f1476a..16d0a49 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "license": "ISC", "description": "", "dependencies": { + "discord.js": "^14.17.3", "dotenv": "^16.4.7", "ejs": "^3.1.10", "ejs-mate": "^4.0.0", diff --git a/src/app.js b/src/app.js index 2710428..bca07f2 100644 --- a/src/app.js +++ b/src/app.js @@ -1,11 +1,13 @@ const express = require("express"); const engine = require("ejs-mate"); const dotenv = require("dotenv"); +dotenv.config(); + +require("./bot/bot"); // import routers const homeRouter = require("./server/routes/home"); -dotenv.config(); const app = express(); diff --git a/src/bot/bot.js b/src/bot/bot.js new file mode 100644 index 0000000..3418729 --- /dev/null +++ b/src/bot/bot.js @@ -0,0 +1,18 @@ +const { Client, GatewayIntentBits } = require("discord.js"); + +const client = new Client({ + intents: [ + GatewayIntentBits.Guilds, + GatewayIntentBits.GuildMembers, + GatewayIntentBits.GuildWebhooks + ] +}); + +client.on("ready", () => { + client.user.setActivity("Set Activity", { type: "WATCHING" }); + console.log(`Discord Bot '${client.user.displayName}' is online!`) +}); + +client.login(process.env.BOT_TOKEN); + +module.exports = client; diff --git a/src/client/views/layout.ejs b/src/client/views/layout.ejs index c0ee1e7..c3dfe74 100644 --- a/src/client/views/layout.ejs +++ b/src/client/views/layout.ejs @@ -6,7 +6,7 @@