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

Mop typings and tweak few things.

This commit is contained in:
AnxietyisReal 2023-05-20 17:17:23 +10:00
parent 776cd9b03b
commit 9d40e3307e
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.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,

View File

@ -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()

View File

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

View File

@ -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<FSPlayer>
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<FSPlayer>
}
}
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<string>,
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<string>
mainServer: mainServer
whitelist: Array<string>,
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 {
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<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
name: string | null
}