From 4fe6e143d18eea7dd6564cc42a0c6298e9698398 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Sat, 20 May 2023 17:17:23 +1000 Subject: [PATCH] Mop typings and tweak few things. --- src/client.ts | 4 +- src/commands/contributors.ts | 2 +- src/config.json | 8 ++ src/typings/interfaces.d.ts | 245 +++++++++++++++++------------------ 4 files changed, 127 insertions(+), 132 deletions(-) diff --git a/src/client.ts b/src/client.ts index 39eb164..fbd8625 100644 --- a/src/client.ts +++ b/src/client.ts @@ -81,7 +81,7 @@ export default class TClient extends Client { this.punishments = new punishments(this); this.bannedWords = new bannedWords(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.repeatedMessages = {}; this.setMaxListeners(20); @@ -93,7 +93,7 @@ export default class TClient extends Client { await mongoose.connect(this.tokens.mongodb_uri, { replicaSet: 'toastyy', autoIndex: true, - authMechanism:'DEFAULT', + authMechanism: 'DEFAULT', authSource: 'admin', serverSelectionTimeoutMS: 15000, waitQueueTimeoutMS: 50000, diff --git a/src/commands/contributors.ts b/src/commands/contributors.ts index 2eda238..e96f242 100644 --- a/src/commands/contributors.ts +++ b/src/commands/contributors.ts @@ -4,7 +4,7 @@ export default { run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){ interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor).setTitle('Daggerbot contributors').setDescription([ '**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'))]}) }, data: new SlashCommandBuilder() diff --git a/src/config.json b/src/config.json index 9cb10a1..d3ec333 100644 --- a/src/config.json +++ b/src/config.json @@ -39,6 +39,14 @@ "141304507249197057", "309373272594579456" ], + "contribList": [ + "190407856527376384", + "615761944154210305", + "633345781780185099", + "215497515934416896", + "141304507249197057", + "178941218510602240" + ], "mainServer": { "id": "468835415093411861", "staffRoles": [ diff --git a/src/typings/interfaces.d.ts b/src/typings/interfaces.d.ts index 5e8f3a5..b26a747 100644 --- a/src/typings/interfaces.d.ts +++ b/src/typings/interfaces.d.ts @@ -28,28 +28,23 @@ export interface Punishment { cancels?: number; duration?: number; } -export interface DSS_serverName { - data: FSData -} export interface FSData { - server: FSServer, - slots: FSslots -} -export interface FSServer { - dayTime: number, - game: string, - mapName: string, - mapSize: number, - mapOverviewFilename: string, - money: number, - name: string, - server: string, - version: string -} -export interface FSslots { - capacity: number, - used: number, - players: Array + server: { + dayTime: number, + game: string, + mapName: string, + mapSize: number, + mapOverviewFilename: string, + money: number, + name: string, + server: string, + version: string + }, + slots: { + capacity: number, + used: number, + players: Array + } } export interface FSPlayer { isUsed: boolean, @@ -58,65 +53,61 @@ export interface FSPlayer { name: string } export interface FSCareerSavegame { - settings: FSCareerSavegameSettings, - statistics: FSCareerSavegameStatistics, - slotSystem: FSCareerSavegameSlotSystem -} -export interface FSCareerSavegameSettings { - savegameName: XMLText, - creationDate: XMLText, - mapId: XMLText, - mapTitle: XMLText, - saveDataFormatted: XMLText, - saveDate: XMLText, - resetVehicles: XMLText, - trafficeEnabled: XMLText, - stopAndGoBraking: XMLText, - trailerFillLimit: XMLText, - automaticMotorStartEnabled: XMLText, - growthMode: XMLText, - fixedSeasonalVisuals: XMLText, - plannedDaysPerPeriod: XMLText, - fruitDestruction: XMLText, - plowingRequiredEnabled: XMLText, - stonesEnabled: XMLText, - weedsEnabled: XMLText, - limeRequired: XMLText, - isSnowEnabled: XMLText, - fuelUsage: XMLText, - helperBuyFuel: XMLText, - helperBuySeeds: XMLText, - helperSlurrySource: XMLText, - helperManureSource: XMLText, - densityMapRevision: XMLText, - terrainTextureRevision: XMLText, - terrainLodTextureRevision: XMLText, - splitShapesRevision: XMLText, - tipCollisionRevision: XMLText, - placementCollisionRevision: XMLText, - navigationCollisionRevision: XMLText, - mapDensityMapRevision: XMLText, - mapTerrainTextureRevision: XMLText, - mapTerrainLodTextureRevision: XMLText, - mapSplitShapesRevision: XMLText, - mapTipCollisionRevision: XMLText, - mapPlacementCollisionRevision: XMLText, - mapNavigationCollisionRevision: XMLText, - difficulty: XMLText, - economicDifficulty: XMLText, - dirtInterval: XMLText, - timeScale: XMLText, - autoSaveInterval: XMLText -} -export interface FSCareerSavegameStatistics { - money: XMLText, - playTime: XMLText -} -export interface FSCareerSavegameSlotSystem { - _attributes: slotUsage -} -interface slotUsage { - slotUsage: string + settings: { + savegameName: XMLText, + creationDate: XMLText, + mapId: XMLText, + mapTitle: XMLText, + saveDataFormatted: XMLText, + saveDate: XMLText, + resetVehicles: XMLText, + trafficeEnabled: XMLText, + stopAndGoBraking: XMLText, + trailerFillLimit: XMLText, + automaticMotorStartEnabled: XMLText, + growthMode: XMLText, + fixedSeasonalVisuals: XMLText, + plannedDaysPerPeriod: XMLText, + fruitDestruction: XMLText, + plowingRequiredEnabled: XMLText, + stonesEnabled: XMLText, + weedsEnabled: XMLText, + limeRequired: XMLText, + isSnowEnabled: XMLText, + fuelUsage: XMLText, + helperBuyFuel: XMLText, + helperBuySeeds: XMLText, + helperSlurrySource: XMLText, + helperManureSource: XMLText, + densityMapRevision: XMLText, + terrainTextureRevision: XMLText, + terrainLodTextureRevision: XMLText, + splitShapesRevision: XMLText, + tipCollisionRevision: XMLText, + placementCollisionRevision: XMLText, + navigationCollisionRevision: XMLText, + mapDensityMapRevision: XMLText, + mapTerrainTextureRevision: XMLText, + mapTerrainLodTextureRevision: XMLText, + mapSplitShapesRevision: XMLText, + mapTipCollisionRevision: XMLText, + mapPlacementCollisionRevision: XMLText, + mapNavigationCollisionRevision: XMLText, + difficulty: XMLText, + economicDifficulty: XMLText, + dirtInterval: XMLText, + timeScale: XMLText, + autoSaveInterval: XMLText + }, + statistics: { + money: XMLText, + playTime: XMLText + }, + slotSystem: { + _attributes: { + slotUsage: string + } + } } interface XMLText { _text: string @@ -141,59 +132,55 @@ export interface Config { embedColorXmas: Discord.ColorResolvable, LRSstart: number, whitelistedServers: Array, - MPStatsLocation: MPStatsLocation, - botSwitches: botSwitches, + MPStatsLocation: { + channel: string, + message: string + }, + botSwitches: { + registerCommands: boolean, + commands: boolean, + logs: boolean, + buttonRoles: boolean, + automod: boolean, + mpstats: boolean, + autores: boolean + }, botPresence: Discord.PresenceData, eval: boolean, - whitelist: Array - mainServer: mainServer + whitelist: Array, + contribList: Array, + mainServer: { + id: string, + staffRoles: Array, + roles: { + admin: string, + bottech: string, + dcmod: string, + mpmanager: string, + mpmod: string, + vtcmanager: string, + vtcstaff: string, + ytmod: string, + mphelper: string, + mpplayer: string, + vtcmember: string + }, + channels: { + console: string, + errors: string, + thismeanswar: string, + bot_status: string, + logs: string, + welcome: string, + botcommands: string, + bankick_log: string, + fs_server_log: string, + punishment_log: string + } + } } export interface MPServerCache { players: FSPlayer[], status: 'online' | 'offline' | null, - name: string | undefined -} -interface MPStatsLocation { - channel: string, - message: string -} -interface botSwitches { - registerCommands: boolean, - commands: boolean, - logs: boolean, - buttonRoles: boolean, - automod: boolean, - mpstats: boolean, - autores: boolean -} -interface mainServer { - id: string, - staffRoles: Array, - roles: mainServerRoles, - channels: mainServerChannels -} -interface mainServerRoles { - admin: string, - bottech: string, - dcmod: string, - mpmanager: string, - mpmod: string, - vtcmanager: string, - vtcstaff: string, - ytmod: string, - mphelper: string, - mpplayer: string, - vtcmember: string -} -interface mainServerChannels { - console: string, - errors: string, - thismeanswar: string, - bot_status: string, - logs: string, - welcome: string, - botcommands: string, - bankick_log: string, - fs_server_log: string, - punishment_log: string + name: string | null } \ No newline at end of file