1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 04:10:59 -05:00

Mop typings and tweak few things.

This commit is contained in:
toast-ts 2023-05-20 17:17:23 +10:00
parent d97c33bbb1
commit ba000f45b8
4 changed files with 127 additions and 132 deletions

View File

@ -81,7 +81,7 @@ export default class TClient extends Client {
this.punishments = new punishments(this); this.punishments = new punishments(this);
this.bannedWords = new bannedWords(this); this.bannedWords = new bannedWords(this);
this.MPServer = new MPServer(this); this.MPServer = new MPServer(this);
this.MPServerCache = {players: [], status: null, name: undefined} as MPServerCache; this.MPServerCache = {players: [], status: null, name: null} as MPServerCache;
this.suggestion = new suggestion(this); this.suggestion = new suggestion(this);
this.repeatedMessages = {}; this.repeatedMessages = {};
this.setMaxListeners(20); this.setMaxListeners(20);
@ -93,7 +93,7 @@ export default class TClient extends Client {
await mongoose.connect(this.tokens.mongodb_uri, { await mongoose.connect(this.tokens.mongodb_uri, {
replicaSet: 'toastyy', replicaSet: 'toastyy',
autoIndex: true, autoIndex: true,
authMechanism:'DEFAULT', authMechanism: 'DEFAULT',
authSource: 'admin', authSource: 'admin',
serverSelectionTimeoutMS: 15000, serverSelectionTimeoutMS: 15000,
waitQueueTimeoutMS: 50000, waitQueueTimeoutMS: 50000,

View File

@ -4,7 +4,7 @@ export default {
run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){ run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor).setTitle('Daggerbot contributors').setDescription([ interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor).setTitle('Daggerbot contributors').setDescription([
'**Thanks to those below that contributed to/developed the bot!**', '**Thanks to those below that contributed to/developed the bot!**',
client.config.whitelist.map(id=>{const member = interaction.guild.members.cache.get(id); return `${member?.user?.username ?? 'N/A'} <@${id}>`}).join('\n') client.config.contribList.map(id=>{const member = interaction.guild.members.cache.get(id); return `${member?.user?.username ?? 'N/A'} <@${id}>`}).join('\n')
].join('\n'))]}) ].join('\n'))]})
}, },
data: new SlashCommandBuilder() data: new SlashCommandBuilder()

View File

@ -39,6 +39,14 @@
"141304507249197057", "141304507249197057",
"309373272594579456" "309373272594579456"
], ],
"contribList": [
"190407856527376384",
"615761944154210305",
"633345781780185099",
"215497515934416896",
"141304507249197057",
"178941218510602240"
],
"mainServer": { "mainServer": {
"id": "468835415093411861", "id": "468835415093411861",
"staffRoles": [ "staffRoles": [

View File

@ -28,14 +28,8 @@ export interface Punishment {
cancels?: number; cancels?: number;
duration?: number; duration?: number;
} }
export interface DSS_serverName {
data: FSData
}
export interface FSData { export interface FSData {
server: FSServer, server: {
slots: FSslots
}
export interface FSServer {
dayTime: number, dayTime: number,
game: string, game: string,
mapName: string, mapName: string,
@ -45,11 +39,12 @@ export interface FSServer {
name: string, name: string,
server: string, server: string,
version: string version: string
} },
export interface FSslots { slots: {
capacity: number, capacity: number,
used: number, used: number,
players: Array<FSPlayer> players: Array<FSPlayer>
}
} }
export interface FSPlayer { export interface FSPlayer {
isUsed: boolean, isUsed: boolean,
@ -58,11 +53,7 @@ export interface FSPlayer {
name: string name: string
} }
export interface FSCareerSavegame { export interface FSCareerSavegame {
settings: FSCareerSavegameSettings, settings: {
statistics: FSCareerSavegameStatistics,
slotSystem: FSCareerSavegameSlotSystem
}
export interface FSCareerSavegameSettings {
savegameName: XMLText, savegameName: XMLText,
creationDate: XMLText, creationDate: XMLText,
mapId: XMLText, mapId: XMLText,
@ -107,16 +98,16 @@ export interface FSCareerSavegameSettings {
dirtInterval: XMLText, dirtInterval: XMLText,
timeScale: XMLText, timeScale: XMLText,
autoSaveInterval: XMLText autoSaveInterval: XMLText
} },
export interface FSCareerSavegameStatistics { statistics: {
money: XMLText, money: XMLText,
playTime: XMLText playTime: XMLText
} },
export interface FSCareerSavegameSlotSystem { slotSystem: {
_attributes: slotUsage _attributes: {
}
interface slotUsage {
slotUsage: string slotUsage: string
}
}
} }
interface XMLText { interface XMLText {
_text: string _text: string
@ -141,23 +132,11 @@ export interface Config {
embedColorXmas: Discord.ColorResolvable, embedColorXmas: Discord.ColorResolvable,
LRSstart: number, LRSstart: number,
whitelistedServers: Array<string>, whitelistedServers: Array<string>,
MPStatsLocation: MPStatsLocation, MPStatsLocation: {
botSwitches: botSwitches,
botPresence: Discord.PresenceData,
eval: boolean,
whitelist: Array<string>
mainServer: mainServer
}
export interface MPServerCache {
players: FSPlayer[],
status: 'online' | 'offline' | null,
name: string | undefined
}
interface MPStatsLocation {
channel: string, channel: string,
message: string message: string
} },
interface botSwitches { botSwitches: {
registerCommands: boolean, registerCommands: boolean,
commands: boolean, commands: boolean,
logs: boolean, logs: boolean,
@ -165,14 +144,15 @@ interface botSwitches {
automod: boolean, automod: boolean,
mpstats: boolean, mpstats: boolean,
autores: boolean autores: boolean
} },
interface mainServer { botPresence: Discord.PresenceData,
eval: boolean,
whitelist: Array<string>,
contribList: Array<string>,
mainServer: {
id: string, id: string,
staffRoles: Array<string>, staffRoles: Array<string>,
roles: mainServerRoles, roles: {
channels: mainServerChannels
}
interface mainServerRoles {
admin: string, admin: string,
bottech: string, bottech: string,
dcmod: string, dcmod: string,
@ -184,8 +164,8 @@ interface mainServerRoles {
mphelper: string, mphelper: string,
mpplayer: string, mpplayer: string,
vtcmember: string vtcmember: string
} },
interface mainServerChannels { channels: {
console: string, console: string,
errors: string, errors: string,
thismeanswar: string, thismeanswar: string,
@ -196,4 +176,11 @@ interface mainServerChannels {
bankick_log: string, bankick_log: string,
fs_server_log: string, fs_server_log: string,
punishment_log: string punishment_log: string
}
}
}
export interface MPServerCache {
players: FSPlayer[],
status: 'online' | 'offline' | null,
name: string | null
} }