@@ -8,9 +8,9 @@ import { Command } from "../index.js";
88import { EmbedList , fetchBingus , fetchBingusData } from "../util.js" ;
99
1010async function getFaqConfig ( ) {
11- return ( await fetchBingusData ( ) ) . faqs . flatMap (
12- ( x ) => x . matched_questions . filter ( ( x ) => x . length > 0 && x . length <= 100 ) ,
13- )
11+ return ( await fetchBingusData ( ) ) . faqs . flatMap ( ( x ) =>
12+ x . matched_questions . filter ( ( x ) => x . length > 0 && x . length <= 100 ) ,
13+ ) ;
1414}
1515
1616let faqConfig = await getFaqConfig ( ) ;
@@ -40,6 +40,10 @@ export const askCommand: Command = {
4040 name : "Visible" ,
4141 value : "VISIBLE" ,
4242 } ,
43+ {
44+ name : "Visible but only you can interact with it" ,
45+ value : "KINDA_VISIBLE" ,
46+ } ,
4347 {
4448 name : "Only first answer" ,
4549 value : "FIRST" ,
@@ -54,7 +58,9 @@ export const askCommand: Command = {
5458 console . log ( `User ${ interaction . user } asked about "${ query } "` ) ;
5559
5660 try {
57- await interaction . deferReply ( { flags : customOption === null ? MessageFlags . Ephemeral : undefined } ) ;
61+ await interaction . deferReply ( {
62+ flags : customOption === null ? MessageFlags . Ephemeral : undefined ,
63+ } ) ;
5864 const data = await fetchBingus ( query ) ;
5965
6066 if ( data . length === 0 ) {
@@ -69,7 +75,8 @@ export const askCommand: Command = {
6975 . setTitle ( data [ 0 ] . title )
7076 . setDescription ( data [ 0 ] . text )
7177 . setColor ( "#65459A" )
72- . setFooter ( { text : `${ data [ 0 ] . relevance . toFixed ( ) } % relevant` } ) . data ,
78+ . setFooter ( { text : `${ data [ 0 ] . relevance . toFixed ( ) } % relevant` } )
79+ . data ,
7380 ] ,
7481 } ) ;
7582
@@ -84,11 +91,12 @@ export const askCommand: Command = {
8491 . setTitle ( res . title )
8592 . setDescription ( res . text )
8693 . setColor ( "#65459A" )
87- . setFooter ( { text : `(${ res . relevance . toFixed ( ) } % relevant)` } ) . data ,
94+ . setFooter ( { text : `(${ res . relevance . toFixed ( ) } % relevant)` } )
95+ . data ,
8896 ) ,
8997 ) ;
9098
91- await embedList . sendChatInput ( interaction ) ;
99+ await embedList . sendChatInput ( interaction , customOption === "KINDA_VISIBLE" ) ;
92100 } catch ( error ) {
93101 console . error ( error ) ;
94102 interaction . editReply ( "An error occurred while fetching results." ) ;
0 commit comments