mirror of
https://github.com/Expand-sys/mcbot
synced 2025-12-17 07:12:13 +11:00
beans
This commit is contained in:
parent
c4cd201e06
commit
f0fe76df4d
2 changed files with 6 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ const fs = require('fs');
|
||||||
const { promisify } = require('util');
|
const { promisify } = require('util');
|
||||||
const { glob } = require('glob');
|
const { glob } = require('glob');
|
||||||
const PG = promisify(glob);
|
const PG = promisify(glob);
|
||||||
const dig = require("gamedig")
|
import { GameDig } from gamedig
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { channelSend } = require('../../utils/utils');
|
const { channelSend } = require('../../utils/utils');
|
||||||
|
|
@ -42,7 +42,7 @@ module.exports = {
|
||||||
function runevery30seconds(i) {
|
function runevery30seconds(i) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
dig.query({
|
GameDig.query({
|
||||||
type: 'minecraft',
|
type: 'minecraft',
|
||||||
host: process.env.MCHOST,
|
host: process.env.MCHOST,
|
||||||
port: process.env.MCHOSTPORT,
|
port: process.env.MCHOSTPORT,
|
||||||
|
|
@ -56,11 +56,11 @@ module.exports = {
|
||||||
restarted = 0;
|
restarted = 0;
|
||||||
count +=1
|
count +=1
|
||||||
//this will be where i do the tracking logic for how long people have been on the server
|
//this will be where i do the tracking logic for how long people have been on the server
|
||||||
if(count == 6){
|
/*if(count == 6){
|
||||||
await dbclient.connect()
|
await dbclient.connect()
|
||||||
//let ping = await dbclient.db("timetracking").command({ ping: 1})
|
//let ping = await dbclient.db("timetracking").command({ ping: 1})
|
||||||
//console.log(ping)
|
//console.log(ping)
|
||||||
let collection = await dbclient.db("timetracking").collection("times")
|
//let collection = await dbclient.db("timetracking").collection("times")
|
||||||
for(i = 0; i < state.players.length; i++){
|
for(i = 0; i < state.players.length; i++){
|
||||||
const query = { name: `${state.players[i].name}`}
|
const query = { name: `${state.players[i].name}`}
|
||||||
const update = { $inc: { time: 1 }}
|
const update = { $inc: { time: 1 }}
|
||||||
|
|
@ -70,7 +70,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
await dbclient.close()
|
await dbclient.close()
|
||||||
count = 0
|
count = 0
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}).catch(async (error) => {
|
}).catch(async (error) => {
|
||||||
console.log("Server is offline " + error);
|
console.log("Server is offline " + error);
|
||||||
|
|
|
||||||
2
index.js
2
index.js
|
|
@ -35,7 +35,7 @@ process.on('SIGINT', (code) => {
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
client,
|
client,
|
||||||
dbclient
|
//dbclient
|
||||||
}
|
}
|
||||||
|
|
||||||
client.login(process.env.BOT_TOKEN);
|
client.login(process.env.BOT_TOKEN);
|
||||||
Loading…
Reference in a new issue