mirror of
https://github.com/Expand-sys/mcbot
synced 2026-03-22 12:37:09 +11:00
patch
This commit is contained in:
parent
ab6a9b562b
commit
6d0ca1ff18
2 changed files with 16 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ const dig = require("gamedig")
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { channelSend } = require('../../utils/utils');
|
const { channelSend } = require('../../utils/utils');
|
||||||
|
const { dbclient } = require('../../index');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
16
index.js
16
index.js
|
|
@ -4,6 +4,19 @@ const Discord = require("discord.js");
|
||||||
|
|
||||||
const client = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers], partials: [Discord.Partials.Channel] });
|
const client = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers], partials: [Discord.Partials.Channel] });
|
||||||
|
|
||||||
|
const { MongoClient, ServerApiVersion } = require('mongodb');
|
||||||
|
const uri = `${process.env.MONGOCONN}`;
|
||||||
|
// Create a MongoClient with a MongoClientOptions object to set the Stable API version
|
||||||
|
const dbclient = new MongoClient(uri, {
|
||||||
|
serverApi: {
|
||||||
|
version: ServerApiVersion.v1,
|
||||||
|
strict: true,
|
||||||
|
deprecationErrors: true,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require('console-stamp')(console, {
|
require('console-stamp')(console, {
|
||||||
format: ':date(dd mmmm yyyy HH:MM:ss) :label'
|
format: ':date(dd mmmm yyyy HH:MM:ss) :label'
|
||||||
});
|
});
|
||||||
|
|
@ -21,7 +34,8 @@ process.on('SIGINT', (code) => {
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
client
|
client,
|
||||||
|
dbclient
|
||||||
}
|
}
|
||||||
|
|
||||||
client.login(process.env.BOT_TOKEN);
|
client.login(process.env.BOT_TOKEN);
|
||||||
Loading…
Reference in a new issue