From 998effff82f578d616a1a49bafa15f6304fefeca Mon Sep 17 00:00:00 2001 From: ikec Date: Tue, 5 Nov 2024 15:54:31 -0800 Subject: [PATCH] :bug: Changing bot.login function location --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index cfa1bae..997b391 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,8 @@ import bot from '@bot'; import { ApplicationCommandRegistries, RegisterBehavior } from "@sapphire/framework"; import * as http from 'http'; +// require('dotenv').config(); + ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite); const server = http.createServer((req, res) => { @@ -12,4 +14,11 @@ const server = http.createServer((req, res) => { server.listen(process.env.CLOUDRUN_PORT, () => { console.log('Hello world listening on port', process.env.CLOUDRUN_PORT); bot.login(process.env.TOKEN) + .then(() => { + console.log('Bot is ready'); + }) + .catch((error) => { + console.error('Error while logging in', error); + }); + console.log('Server running at http://localhost:' + process.env.CLOUDRUN_PORT + '/'); });