File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 8
8
Effect ,
9
9
Http ,
10
10
Layer ,
11
+ Option ,
11
12
Schedule ,
12
13
Schema ,
13
14
SchemaClass ,
@@ -88,19 +89,30 @@ const make = Effect.gen(function* (_) {
88
89
required : true ,
89
90
autocomplete : true ,
90
91
} ,
92
+ {
93
+ type : Discord . ApplicationCommandOptionType . BOOLEAN ,
94
+ name : "silent" ,
95
+ description : "Only show the results to you" ,
96
+ required : false ,
97
+ } ,
91
98
] ,
92
99
} ,
93
100
ix =>
94
101
pipe (
95
102
Effect . all ( {
96
103
key : ix . optionValue ( "query" ) ,
104
+ silent : Effect . map (
105
+ ix . optionValueOptional ( "silent" ) ,
106
+ Option . getOrElse ( ( ) => false ) ,
107
+ ) ,
97
108
docs : allDocs ,
98
109
} ) ,
99
110
Effect . bind ( "embed" , ( { key, docs } ) => docs [ 1 ] [ key ] . embed ) ,
100
- Effect . map ( ( { embed } ) =>
111
+ Effect . map ( ( { embed, silent } ) =>
101
112
Ix . response ( {
102
113
type : Discord . InteractionCallbackType . CHANNEL_MESSAGE_WITH_SOURCE ,
103
114
data : {
115
+ flags : silent ? Discord . MessageFlag . EPHEMERAL : undefined ,
104
116
embeds : [ embed ] ,
105
117
} ,
106
118
} ) ,
You can’t perform that action at this time.
0 commit comments