Skip to content

Commit

Permalink
🐛 Changing bot.login function location
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack41784090 committed Nov 5, 2024
1 parent 26edecb commit 998efff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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 + '/');
});

0 comments on commit 998efff

Please sign in to comment.