1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-27 20:35:38 -05:00

mpstats test

This commit is contained in:
AnxietyisReal 2022-11-22 21:33:29 +11:00
parent cb5063b1f3
commit 7d271eb9a6
3 changed files with 6 additions and 7 deletions

View File

@ -204,7 +204,6 @@ export class TClient extends Client {
const unpunishResult = await this.punishments.removePunishment(punishment.id, interaction.user.id, reason);
interaction.reply(unpunishResult)
}
async YTLoop(YTChannelID: string, YTChannelName: string, DCChannelID: string){
let Data:any;
let error;

View File

@ -9,8 +9,8 @@
"registerCommands": true,
"commands": false,
"logs": true,
"automod": true,
"mpstats": false,
"automod": false,
"mpstats": true,
"mpstatsDebug": false,
"autores": false
},

View File

@ -4,12 +4,12 @@ const client = new TClient;
client.init();
import fs from 'node:fs';
import MPDB from './models/MPServer';
import { Punishment, UserLevels } from './typings/interfaces';
import {Punishment, UserLevels} from './typings/interfaces';
client.on('ready', async()=>{
client.guilds.cache.forEach(async(e: { members: { fetch: () => any; }; })=>{await e.members.fetch()});
setInterval(async()=>{
client.user.setPresence({activities: [{ name: 'Slash commands!', type: 0 }], status: 'online'});
client.user.setPresence({activities: [{ name: 'Slash commands!', type: 1, url: 'https://www.youtube.com/watch?v=eO9YZsJmjlM' }], status: 'online'});
// Playing: 0, Streaming (Requires YT/Twitch URL to work): 1, Listening to: 2, Watching: 3, Competing in: 5
}, 60000);
if (client.config.botSwitches.registerCommands) (client.guilds.cache.get(client.config.mainServer.id) as Discord.Guild).commands.set(client.registry).catch((e)=>{console.log(`Couldn't register slash commands: ${e}`)})
@ -50,11 +50,11 @@ process.on('error', async(error: Error)=>{
// Daggerwin MP loop
setInterval(async()=>{
if (!client.config.botSwitches.mpstats) return;
const msg = await (client.channels.resolve('904192878140608563') as Discord.TextChannel).messages.fetch('1042835699906400346')
const msg = await (client.channels.resolve('904192878140608563') as Discord.TextChannel).messages.fetch('1044552089340219422')
const embed = new client.embed();
let Players = [];
let Server: any;
let CSG;
let CSG: any;
let xmlData = undefined;
// Connect to DB to retrieve the Gameserver info to fetch data.