Skip to content

Commit 2ad21b5

Browse files
authoredMar 23, 2024··
fix: resolved issue with registerOptions not picking up default options correctly (#738)
1 parent af4115a commit 2ad21b5

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed
 

‎src/lib/utils/application-commands/ApplicationCommandRegistry.ts

+16-10
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,16 @@ export class ApplicationCommandRegistry {
108108

109109
const guildIdsToRegister = this.getGuildIdsToRegister(options);
110110

111+
const registerOptions = {
112+
registerCommandIfMissing: true,
113+
behaviorWhenNotIdentical: getDefaultBehaviorWhenNotIdentical(),
114+
guildIds: guildIdsToRegister,
115+
...(options ?? {})
116+
};
117+
111118
this.apiCalls.push({
112119
builtData,
113-
registerOptions: options ?? {
114-
registerCommandIfMissing: true,
115-
behaviorWhenNotIdentical: getDefaultBehaviorWhenNotIdentical(),
116-
guildIds: guildIdsToRegister
117-
},
120+
registerOptions,
118121
type: InternalRegistryAPIType.ChatInput
119122
});
120123

@@ -143,13 +146,16 @@ export class ApplicationCommandRegistry {
143146

144147
const guildIdsToRegister = this.getGuildIdsToRegister(options);
145148

149+
const registerOptions = {
150+
registerCommandIfMissing: true,
151+
behaviorWhenNotIdentical: getDefaultBehaviorWhenNotIdentical(),
152+
guildIds: guildIdsToRegister,
153+
...(options ?? {})
154+
};
155+
146156
this.apiCalls.push({
147157
builtData,
148-
registerOptions: options ?? {
149-
registerCommandIfMissing: true,
150-
behaviorWhenNotIdentical: getDefaultBehaviorWhenNotIdentical(),
151-
guildIds: guildIdsToRegister
152-
},
158+
registerOptions,
153159
type: InternalRegistryAPIType.ContextMenu
154160
});
155161

0 commit comments

Comments
 (0)
Please sign in to comment.