File tree Expand file tree Collapse file tree 9 files changed +31
-8
lines changed Expand file tree Collapse file tree 9 files changed +31
-8
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ console.info("[BİLGİ] Basit Altyapı v1.8.6 - by Kıraç Armağan Önal");
151151
152152 let uInter = Underline . interactions . find ( uInter => {
153153 switch ( uInter . name . length ) {
154- case 1 : return ( uInter . name [ 0 ] == interaction . commandName ) || ( ( uInter . name [ 0 ] == interaction . customId ) && (
154+ case 1 : return ( uInter . name [ 0 ] == interaction . commandName ) || ( ( uInter . id == interaction . customId ) && (
155155 ( uInter . actionType == "CHAT_INPUT" && ( interaction . isCommand ( ) || interaction . isAutocomplete ( ) ) ) ||
156156 ( uInter . actionType == "SELECT_MENU" && interaction . isSelectMenu ( ) ) ||
157157 ( uInter . actionType == "BUTTON" && interaction . isButton ( ) ) ||
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ module.exports = new Underline.SlashCommand({
88 {
99 type : "ACTION_ROW" ,
1010 components : [
11- Underline . interactions . get ( "basBana " ) . toJSON ( )
11+ Underline . interactions . get ( "secBeni " ) . toJSON ( )
1212 ]
1313 }
1414 ]
File renamed without changes.
Original file line number Diff line number Diff line change 1+ module . exports = new Underline . SelectMenu ( {
2+ id : "secBeni" ,
3+ name : "secBeni" ,
4+ description : "..." ,
5+ onInteraction ( inter , other ) {
6+ inter . reply ( {
7+ content : inter . values [ 0 ] || "yok bişi seç." ,
8+ ephemeral : true
9+ } )
10+ } ,
11+ options : {
12+ get choices ( ) {
13+ return Array ( 25 ) . fill ( "" ) . map ( ( _ , i ) => ( { label : Math . random ( ) . toString ( ) , value : `${ i } ` } ) )
14+ }
15+ } ,
16+ guildOnly : false ,
17+ developerOnly : false
18+ } ) ;
Original file line number Diff line number Diff line change @@ -214,12 +214,13 @@ makeSureFolderExistsSync("./events");
214214 }
215215 let resultText = `
216216module.exports = new Underline.${ transformer [ interActionType ] ?? "" } ({
217+ ${ interActionType == "BUTTON" || interActionType == "SELECT_MENU" ? `id: ${ JSON . stringify ( interName ) } ,` : "" }
217218 name: ${ JSON . stringify ( interName ) } ,
218219 ${ interDesc ? `description: ${ JSON . stringify ( interDesc ) } ,` : "" }
219220 onInteraction(inter, other) {
220221 // Kodunuz bruh, kolay gelsin!
221222 },
222- ${ interActionType == "BUTTON " || interActionType == "MESSAGE" || interActionType == "USER " ? "" : "options: []," }
223+ ${ interActionType == "MESSAGE " || interActionType == "USER" ? "" : `options: ${ interActionType == "BUTTON" || interActionType == "SELECT_MENU " ? "{} " : "[]" } ,` }
223224 ${ interCoolDown ? `coolDown: ${ interCoolDown } ,` : "" }
224225 guildOnly: ${ interGuildOnly } ,
225226 developerOnly: ${ interDeveloperOnly } ${ interBotPerms . length > 0 || interUserPerms . length > 0 ? `,` : "" }
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ class Button extends Interaction {
1212 }
1313 isButton ( ) { return true ; }
1414 toJSON ( ) {
15- let button = new MessageButton ( ) . setCustomId ( this . name [ 0 ] ) . setStyle ( this . options . style )
15+ let button = new MessageButton ( )
16+ . setCustomId ( this . id )
17+ . setStyle ( this . options . style ) ;
1618 if ( this . options . emoji ) button . setEmoji ( this . options . emoji ) ;
1719 if ( this . options . label ) button . setLabel ( this . options . label ) ;
1820 if ( this . options . url ) button . setURL ( this . options . url ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ interface CustomSelectMenuOptions {
2525 max ?: number ;
2626 choices : MessageSelectOptionData [ ] ;
2727 placeholder ?: string ;
28- onComplete ?( interaction : SelectMenuInteraction ) : MessageSelectOptionData [ ]
2928}
3029
3130interface CustomButtonOptions {
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class Interaction {
4141 this . name = Array . isArray ( arg . name ) ? arg . name : [ arg . name ] ;
4242 this . actionType = arg . actionType || Underline . config . interactionDefaults . actionType ;
4343
44- this . id = arg . id || `${ this . actionType } : ${ this . name . join ( " " ) } ` ;
44+ this . id = arg . id || `${ this . actionType } _ ${ this . name . join ( "_ " ) } ` . toLowerCase ( ) ;
4545 this . _type = arg . _type ?? this . _type ;
4646 this . perms . bot = Array . isArray ( arg . perms ?. bot ) && arg . perms . bot . length != 0 ? arg . perms . bot : Underline . config . interactionDefaults . perms . bot ;
4747 this . perms . user = Array . isArray ( arg . perms ?. user ) && arg . perms . user . length != 0 ? arg . perms . user : Underline . config . interactionDefaults . perms . user ;
Original file line number Diff line number Diff line change @@ -16,8 +16,11 @@ class SelectMenu extends Interaction {
1616 isUserActionCommand ( ) { return false ; }
1717 isMessageActionCommand ( ) { return false ; }
1818 toJSON ( ) {
19- let menu = new MessageSelectMenu ( ) . addOptions ( this . options ?. onComplete ? this . options . onComplete ( ) : ( this . options ?. choices ?? [ ] ) )
20- . setMinValues ( this . options . min ?? 1 ) . setMaxValues ( this . options . max ?? this . options . choices . length ) . setCustomId ( this . name )
19+ let menu = new MessageSelectMenu ( )
20+ . addOptions ( this . options ?. choices ?? [ ] )
21+ . setMinValues ( this . options . min ?? 1 )
22+ . setMaxValues ( this . options . max ?? this . options . choices . length )
23+ . setCustomId ( this . id ) ;
2124 if ( this . options . placeholder ) menu . setPlaceholder ( this . options . placeholder )
2225 return menu ;
2326 }
You can’t perform that action at this time.
0 commit comments