1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 16:30:58 -05:00

Mop typings and tweak few things.

This commit is contained in:
AnxietyisReal 2023-05-20 17:17:23 +10:00
parent 134d329b03
commit 4fe6e143d1
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,28 +28,23 @@ 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 dayTime: number,
} game: string,
export interface FSServer { mapName: string,
dayTime: number, mapSize: number,
game: string, mapOverviewFilename: string,
mapName: string, money: number,
mapSize: number, name: string,
mapOverviewFilename: string, server: string,
money: number, version: string
name: string, },
server: string, slots: {
version: string capacity: number,
} used: number,
export interface FSslots { players: Array<FSPlayer>
capacity: number, }
used: number,
players: Array<FSPlayer>
} }
export interface FSPlayer { export interface FSPlayer {
isUsed: boolean, isUsed: boolean,
@ -58,65 +53,61 @@ export interface FSPlayer {
name: string name: string
} }
export interface FSCareerSavegame { export interface FSCareerSavegame {
settings: FSCareerSavegameSettings, settings: {
statistics: FSCareerSavegameStatistics, savegameName: XMLText,
slotSystem: FSCareerSavegameSlotSystem creationDate: XMLText,
} mapId: XMLText,
export interface FSCareerSavegameSettings { mapTitle: XMLText,
savegameName: XMLText, saveDataFormatted: XMLText,
creationDate: XMLText, saveDate: XMLText,
mapId: XMLText, resetVehicles: XMLText,
mapTitle: XMLText, trafficeEnabled: XMLText,
saveDataFormatted: XMLText, stopAndGoBraking: XMLText,
saveDate: XMLText, trailerFillLimit: XMLText,
resetVehicles: XMLText, automaticMotorStartEnabled: XMLText,
trafficeEnabled: XMLText, growthMode: XMLText,
stopAndGoBraking: XMLText, fixedSeasonalVisuals: XMLText,
trailerFillLimit: XMLText, plannedDaysPerPeriod: XMLText,
automaticMotorStartEnabled: XMLText, fruitDestruction: XMLText,
growthMode: XMLText, plowingRequiredEnabled: XMLText,
fixedSeasonalVisuals: XMLText, stonesEnabled: XMLText,
plannedDaysPerPeriod: XMLText, weedsEnabled: XMLText,
fruitDestruction: XMLText, limeRequired: XMLText,
plowingRequiredEnabled: XMLText, isSnowEnabled: XMLText,
stonesEnabled: XMLText, fuelUsage: XMLText,
weedsEnabled: XMLText, helperBuyFuel: XMLText,
limeRequired: XMLText, helperBuySeeds: XMLText,
isSnowEnabled: XMLText, helperSlurrySource: XMLText,
fuelUsage: XMLText, helperManureSource: XMLText,
helperBuyFuel: XMLText, densityMapRevision: XMLText,
helperBuySeeds: XMLText, terrainTextureRevision: XMLText,
helperSlurrySource: XMLText, terrainLodTextureRevision: XMLText,
helperManureSource: XMLText, splitShapesRevision: XMLText,
densityMapRevision: XMLText, tipCollisionRevision: XMLText,
terrainTextureRevision: XMLText, placementCollisionRevision: XMLText,
terrainLodTextureRevision: XMLText, navigationCollisionRevision: XMLText,
splitShapesRevision: XMLText, mapDensityMapRevision: XMLText,
tipCollisionRevision: XMLText, mapTerrainTextureRevision: XMLText,
placementCollisionRevision: XMLText, mapTerrainLodTextureRevision: XMLText,
navigationCollisionRevision: XMLText, mapSplitShapesRevision: XMLText,
mapDensityMapRevision: XMLText, mapTipCollisionRevision: XMLText,
mapTerrainTextureRevision: XMLText, mapPlacementCollisionRevision: XMLText,
mapTerrainLodTextureRevision: XMLText, mapNavigationCollisionRevision: XMLText,
mapSplitShapesRevision: XMLText, difficulty: XMLText,
mapTipCollisionRevision: XMLText, economicDifficulty: XMLText,
mapPlacementCollisionRevision: XMLText, dirtInterval: XMLText,
mapNavigationCollisionRevision: XMLText, timeScale: XMLText,
difficulty: XMLText, autoSaveInterval: XMLText
economicDifficulty: XMLText, },
dirtInterval: XMLText, statistics: {
timeScale: XMLText, money: XMLText,
autoSaveInterval: XMLText playTime: XMLText
} },
export interface FSCareerSavegameStatistics { slotSystem: {
money: XMLText, _attributes: {
playTime: XMLText slotUsage: string
} }
export interface FSCareerSavegameSlotSystem { }
_attributes: slotUsage
}
interface slotUsage {
slotUsage: string
} }
interface XMLText { interface XMLText {
_text: string _text: string
@ -141,59 +132,55 @@ export interface Config {
embedColorXmas: Discord.ColorResolvable, embedColorXmas: Discord.ColorResolvable,
LRSstart: number, LRSstart: number,
whitelistedServers: Array<string>, whitelistedServers: Array<string>,
MPStatsLocation: MPStatsLocation, MPStatsLocation: {
botSwitches: botSwitches, channel: string,
message: string
},
botSwitches: {
registerCommands: boolean,
commands: boolean,
logs: boolean,
buttonRoles: boolean,
automod: boolean,
mpstats: boolean,
autores: boolean
},
botPresence: Discord.PresenceData, botPresence: Discord.PresenceData,
eval: boolean, eval: boolean,
whitelist: Array<string> whitelist: Array<string>,
mainServer: mainServer contribList: Array<string>,
mainServer: {
id: string,
staffRoles: Array<string>,
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 { export interface MPServerCache {
players: FSPlayer[], players: FSPlayer[],
status: 'online' | 'offline' | null, status: 'online' | 'offline' | null,
name: string | undefined name: string | null
}
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<string>,
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
} }