mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 04:10:59 -05:00
kevin x4
This commit is contained in:
parent
fa2e74a8c0
commit
55df26eece
@ -4,6 +4,8 @@ import { Database } from './database';
|
|||||||
import timeNames from './timeNames';
|
import timeNames from './timeNames';
|
||||||
import { Punishment, formatTimeOpt, createTableOpt, punOpt } from './typings/interfaces';
|
import { Punishment, formatTimeOpt, createTableOpt, punOpt } from './typings/interfaces';
|
||||||
import MPDB from './models/MPServer';
|
import MPDB from './models/MPServer';
|
||||||
|
import axios from 'axios';
|
||||||
|
import moment from 'moment';
|
||||||
export class TClient extends Client {
|
export class TClient extends Client {
|
||||||
invites: Map<any, any>;
|
invites: Map<any, any>;
|
||||||
commands: Discord.Collection<string, any>;
|
commands: Discord.Collection<string, any>;
|
||||||
@ -15,9 +17,9 @@ export class TClient extends Client {
|
|||||||
collection: any;
|
collection: any;
|
||||||
messageCollector: any;
|
messageCollector: any;
|
||||||
attachmentBuilder: any;
|
attachmentBuilder: any;
|
||||||
moment: any;
|
moment: typeof moment;
|
||||||
xjs: any;
|
xjs: any;
|
||||||
axios: any;
|
axios: typeof axios;
|
||||||
ms: any;
|
ms: any;
|
||||||
userLevels: userLevels;
|
userLevels: userLevels;
|
||||||
punishments: punishments;
|
punishments: punishments;
|
||||||
@ -52,9 +54,9 @@ export class TClient extends Client {
|
|||||||
this.collection = Discord.Collection;
|
this.collection = Discord.Collection;
|
||||||
this.messageCollector = Discord.MessageCollector;
|
this.messageCollector = Discord.MessageCollector;
|
||||||
this.attachmentBuilder = Discord.AttachmentBuilder;
|
this.attachmentBuilder = Discord.AttachmentBuilder;
|
||||||
this.moment = require('moment');
|
this.moment = moment;
|
||||||
this.xjs = require('xml-js');
|
this.xjs = require('xml-js');
|
||||||
this.axios = require('axios');
|
this.axios = axios;
|
||||||
this.ms = require('ms');
|
this.ms = require('ms');
|
||||||
this.userLevels = new userLevels(this);
|
this.userLevels = new userLevels(this);
|
||||||
this.bonkCount = new bonkCount(this);
|
this.bonkCount = new bonkCount(this);
|
||||||
|
@ -74,7 +74,7 @@ setInterval(async()=>{
|
|||||||
};
|
};
|
||||||
if (!verifyURL) return msg.edit({content: 'Invalid gameserver IP, please update!', embeds: null})
|
if (!verifyURL) return msg.edit({content: 'Invalid gameserver IP, please update!', embeds: null})
|
||||||
async function serverData(client:TClient, URL: string){
|
async function serverData(client:TClient, URL: string){
|
||||||
return await client.axios.get(URL, {timeout: 4000, headers: {'User-Agent': `Daggerbot/axios ${client.axios.version}`}}).catch((error:Error)=>error.message)
|
return await client.axios.get(URL, {timeout: 4000, headers: {'User-Agent': `Daggerbot/axios ${client.axios.VERSION}`}}).catch((error:Error)=>error.message)
|
||||||
}
|
}
|
||||||
await Promise.all([serverData(client, completedURL_DSS), serverData(client, completedURL_CSG)]).then(function(results){
|
await Promise.all([serverData(client, completedURL_DSS), serverData(client, completedURL_CSG)]).then(function(results){
|
||||||
if (typeof results[0] == 'string'){
|
if (typeof results[0] == 'string'){
|
||||||
|
Loading…
Reference in New Issue
Block a user