Skip to content

Commit

Permalink
fix: resolved issue with registerOptions not picking up default optio…
Browse files Browse the repository at this point in the history
…ns correctly (#738)
  • Loading branch information
favna committed Mar 23, 2024
1 parent af4115a commit 2ad21b5
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/lib/utils/application-commands/ApplicationCommandRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ export class ApplicationCommandRegistry {

const guildIdsToRegister = this.getGuildIdsToRegister(options);

const registerOptions = {
registerCommandIfMissing: true,
behaviorWhenNotIdentical: getDefaultBehaviorWhenNotIdentical(),
guildIds: guildIdsToRegister,
...(options ?? {})
};

this.apiCalls.push({
builtData,
registerOptions: options ?? {
registerCommandIfMissing: true,
behaviorWhenNotIdentical: getDefaultBehaviorWhenNotIdentical(),
guildIds: guildIdsToRegister
},
registerOptions,
type: InternalRegistryAPIType.ChatInput
});

Expand Down Expand Up @@ -143,13 +146,16 @@ export class ApplicationCommandRegistry {

const guildIdsToRegister = this.getGuildIdsToRegister(options);

const registerOptions = {
registerCommandIfMissing: true,
behaviorWhenNotIdentical: getDefaultBehaviorWhenNotIdentical(),
guildIds: guildIdsToRegister,
...(options ?? {})
};

this.apiCalls.push({
builtData,
registerOptions: options ?? {
registerCommandIfMissing: true,
behaviorWhenNotIdentical: getDefaultBehaviorWhenNotIdentical(),
guildIds: guildIdsToRegister
},
registerOptions,
type: InternalRegistryAPIType.ContextMenu
});

Expand Down

0 comments on commit 2ad21b5

Please sign in to comment.