From 63c5717ccd2e9c66e0c9152b6fe3e5c10cc44602 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:22:28 +1100 Subject: [PATCH] kevin x4 --- src/client.ts | 10 ++++++---- src/index.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client.ts b/src/client.ts index edaac7c..740a9d8 100644 --- a/src/client.ts +++ b/src/client.ts @@ -4,6 +4,8 @@ import { Database } from './database'; import timeNames from './timeNames'; import { Punishment, formatTimeOpt, createTableOpt, punOpt } from './typings/interfaces'; import MPDB from './models/MPServer'; +import axios from 'axios'; +import moment from 'moment'; export class TClient extends Client { invites: Map; commands: Discord.Collection; @@ -15,9 +17,9 @@ export class TClient extends Client { collection: any; messageCollector: any; attachmentBuilder: any; - moment: any; + moment: typeof moment; xjs: any; - axios: any; + axios: typeof axios; ms: any; userLevels: userLevels; punishments: punishments; @@ -52,9 +54,9 @@ export class TClient extends Client { this.collection = Discord.Collection; this.messageCollector = Discord.MessageCollector; this.attachmentBuilder = Discord.AttachmentBuilder; - this.moment = require('moment'); + this.moment = moment; this.xjs = require('xml-js'); - this.axios = require('axios'); + this.axios = axios; this.ms = require('ms'); this.userLevels = new userLevels(this); this.bonkCount = new bonkCount(this); diff --git a/src/index.ts b/src/index.ts index 1d9afdd..43b337e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -74,7 +74,7 @@ setInterval(async()=>{ }; if (!verifyURL) return msg.edit({content: 'Invalid gameserver IP, please update!', embeds: null}) 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){ if (typeof results[0] == 'string'){