Update client.ts

This commit is contained in:
DJj123dj
2024-11-18 20:50:02 +01:00
parent a31588f025
commit f8da68607d
+8 -3
View File
@@ -637,8 +637,6 @@ export type ODSlashCommandUpdateFunction = (current:ODSlashCommandBuilder) => bo
export class ODSlashCommand extends ODManagerData { export class ODSlashCommand extends ODManagerData {
/**The discord.js builder for this slash command. */ /**The discord.js builder for this slash command. */
builder: ODSlashCommandBuilder builder: ODSlashCommandBuilder
/**The name of this slash command. */
name: string
/**The id of the guild this command is for. Null when not set. */ /**The id of the guild this command is for. Null when not set. */
guildId: string|null guildId: string|null
/**Function to check if the slash command requires to be updated (when it already exists). */ /**Function to check if the slash command requires to be updated (when it already exists). */
@@ -649,10 +647,17 @@ export class ODSlashCommand extends ODManagerData {
if (builder.type != discord.ApplicationCommandType.ChatInput) throw new ODSystemError("ApplicationCommandData is required to be the 'ChatInput' type!") if (builder.type != discord.ApplicationCommandType.ChatInput) throw new ODSystemError("ApplicationCommandData is required to be the 'ChatInput' type!")
this.builder = builder this.builder = builder
this.name = builder.name
this.guildId = guildId ?? null this.guildId = guildId ?? null
this.requiresUpdate = requiresUpdate ?? null this.requiresUpdate = requiresUpdate ?? null
} }
/**The name of this slash command. */
get name(): string {
return this.builder.name
}
set name(name:string){
this.builder.name = name
}
} }
/**## ODTextCommandBuilderBaseOptionType `type` /**## ODTextCommandBuilderBaseOptionType `type`