aboutsummaryrefslogtreecommitdiff
path: root/bot/src/bot.js
diff options
context:
space:
mode:
authorAndrew Lee <andrew@alee14.me>2025-03-03 11:42:27 -0500
committerAndrew Lee <andrew@alee14.me>2025-03-03 11:42:27 -0500
commitfd7f8eba960981482fabf350995bf753feebb176 (patch)
tree2bd0c85b09a04ecd8e1f20fc409eb4b8a22289a7 /bot/src/bot.js
parentcf1382d88c5e3298923c8cb243b7bc5751e68b53 (diff)
downloadAleeBot-fd7f8eba960981482fabf350995bf753feebb176.tar.gz
AleeBot-fd7f8eba960981482fabf350995bf753feebb176.tar.bz2
AleeBot-fd7f8eba960981482fabf350995bf753feebb176.zip
More commands ported; Almost all 2.x features have been added
Diffstat (limited to 'bot/src/bot.js')
-rw-r--r--bot/src/bot.js31
1 files changed, 16 insertions, 15 deletions
diff --git a/bot/src/bot.js b/bot/src/bot.js
index 7f1f41a..95871e0 100644
--- a/bot/src/bot.js
+++ b/bot/src/bot.js
@@ -3,21 +3,22 @@ import 'dotenv/config';
import { event } from './handlers/event.js';
import { command } from './handlers/command.js';
import { apiServer } from './api/server.js';
+import { syncDB } from './utils/sync.js';
+//import { deployCommands } from './util/deploy.js';
-const client = new Client({ intents: [GatewayIntentBits.Guilds] });
+const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers] });
-command(client).then(() => console.log('[>] Command module loaded'));
-event(client).then(() => console.log('[>] Event module loaded'));
-apiServer(client);
-
-if (process.argv.indexOf('--beta') === -1) {
- client.login(process.env.abtoken).catch(function() {
- console.log('[X] Login failed. The token that you have put in is invalid.');
- process.exit(0);
- });
-} else {
- client.login(process.env.abbtoken).catch(function() {
- console.log('[X] Login failed. The token that you have put in is invalid.');
- process.exit(0);
- });
+async function init(client) {
+ await syncDB();
+ //deployCommands().then(() => console.log('[>] Deployed commands'));
+ await apiServer(client);
+ await event(client).then(() => console.log('[>] Event module loaded'));
+ await command(client).then(() => console.log('[>] Command module loaded'));
}
+
+init(client);
+
+client.login(process.env.token).catch(function() {
+ console.log('[X] Login failed. The token that you have put in is invalid.');
+ process.exit(1);
+});