From d052c0ea12e6a14337789fc73908f42cd0fdcf76 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 28 Mar 2025 15:28:49 -0400 Subject: Replaced abtoken.json with .env --- .gitignore | 3 ++- aleebot.js | 4 ++-- bun.lockb | Bin 10318 -> 10659 bytes package.json | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 71f8e34..9a919f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -abtoken.json \ No newline at end of file +abtoken.json +.env \ No newline at end of file diff --git a/aleebot.js b/aleebot.js index 0e42392..7460daa 100755 --- a/aleebot.js +++ b/aleebot.js @@ -11,7 +11,7 @@ * *************************************/ const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] }); -const config = require('./abtoken.json'); +require('dotenv').config(); var prefix = "ab:"; @@ -181,7 +181,7 @@ client.on('messageCreate', message => { }); - client.login (config.token).catch(function() { + client.login (process.env.TOKEN).catch(function() { console.log("[ERROR] Login failed."); }); diff --git a/bun.lockb b/bun.lockb index 958525b..a5e706c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 1b1c185..3b2a9d1 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "dependencies": { "discord.js": "^14.18.0" + }, + "devDependencies": { + "dotenv": "^16.4.7" } } \ No newline at end of file -- cgit v1.2.3