File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import type {
55 ButtonConfig ,
66 CommandConfig ,
77 ContextMenuConfig ,
8+ ContextMenuType ,
89 EventOptions ,
910 Harmonix ,
1011 HarmonixButton ,
@@ -86,13 +87,13 @@ export const resolveContextMenu = (
8687 const matchSuffix = filename ( _ctmPath ) . match ( / \. ( u s e r | m e s s a g e ) ? $ / )
8788 const type =
8889 contextMenu . config . type ??
89- ( matchSuffix ? ( matchSuffix [ 1 ] as 'message' | 'user' ) : null )
90+ ( matchSuffix ? ( matchSuffix [ 1 ] as ContextMenuType ) : null )
9091 const name =
9192 contextMenu . config . name ??
9293 filename ( _ctmPath ) . replace ( / \. ( u s e r | m e s s a g e ) ? $ / , '' )
9394 const config : ContextMenuConfig = {
9495 name,
95- type : type ?? 'message ' ,
96+ type : type ?? 'Message ' ,
9697 ...contextMenu . config
9798 }
9899
Original file line number Diff line number Diff line change @@ -29,15 +29,17 @@ export type SelectMenuCallback<T extends SelectMenuType = SelectMenuType> = (
2929 : MentionableSelectMenuInteraction
3030) => void
3131
32+ interface StringOptionDef {
33+ label : string
34+ value : string
35+ description ?: string
36+ emoji ?: ComponentEmojiResolvable
37+ default ?: boolean
38+ }
39+
3240export interface StringSelectMenuConfig {
3341 type : 'String'
34- options : {
35- label : string
36- value : string
37- description ?: string
38- emoji ?: ComponentEmojiResolvable
39- default ?: boolean
40- } [ ]
42+ options : StringOptionDef [ ]
4143}
4244
4345export interface UserSelectMenuConfig {
Original file line number Diff line number Diff line change @@ -154,9 +154,9 @@ export const contextMenuToJSON = (ctm: HarmonixContextMenu) => {
154154 const builder = new ContextMenuCommandBuilder ( )
155155 . setName ( ctm . config . name ! )
156156 . setType (
157- ctm . config . type === 'message '
157+ ctm . config . type === 'Message '
158158 ? ApplicationCommandType . Message
159- : ctm . config . type === 'user '
159+ : ctm . config . type === 'User '
160160 ? ApplicationCommandType . User
161161 : ApplicationCommandType . Message
162162 )
You can’t perform that action at this time.
0 commit comments