File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { ApplicationCommandOptionType } from 'discord.js' ;
2+ import { createCommands } from '../index.js' ;
3+ import { type DocProvider , docProviders , executeDocCommand } from './providers.js' ;
4+
5+ export default createCommands (
6+ Object . entries ( docProviders ) . map ( ( [ providerKey , providerConfig ] ) => ( {
7+ data : {
8+ name : providerKey ,
9+ description : providerConfig . commandDescription ,
10+ options : [
11+ {
12+ name : 'query' ,
13+ type : ApplicationCommandOptionType . String ,
14+ description : 'The search query' ,
15+ required : true ,
16+ } ,
17+ {
18+ name : 'user' ,
19+ type : ApplicationCommandOptionType . User ,
20+ description : 'The user to mention in the response' ,
21+ required : false ,
22+ } ,
23+ ] ,
24+ } ,
25+ execute : async ( interaction ) => executeDocCommand ( providerKey as DocProvider , interaction ) ,
26+ } ) )
27+ ) ;
You can’t perform that action at this time.
0 commit comments