File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,6 @@ docker build . -t tphdocsbot:latest
1818docker run -e TOKEN=<your discord token> -e APPLICATIONID=<ApplicationID> -e GUILDID=<GuildID> tphdocsbot:latest
1919```
2020
21- Or put the values in a local file and use that using..
22-
23- ``` console
24- docker run --env-file .env tphdocsbot:latest
25- ```
26-
2721### Cofiguration
2822
2923* ` TOKEN ` [ required] the Discord bot token to run under
Original file line number Diff line number Diff line change @@ -29,17 +29,18 @@ const command: Command = {
2929 )
3030 . addChoices ( supportedBranches )
3131 . setRequired ( false )
32- ) ,
32+ ) . addBooleanOption ( option => option . setName ( "private" ) . setDescription ( "Whether or not to search private elements (default false)" ) . setRequired ( false ) ) ,
3333 async execute ( interaction ) {
3434 const query = interaction . options . getString ( "query" ) ;
3535 // The Default source should be stable
3636 const source : keyof typeof sources =
3737 ( interaction . options . getString ( "source" ) as keyof typeof sources ) ||
3838 "stable" ;
39-
39+ // Whether to include private elements on the search results, by default false, shows private elements if the search returns an exact result;
40+ const searchPrivate = interaction . options . getBoolean ( "private" ) || false ;
4041 const doc = await Doc . fetch ( source , { force : true } ) ;
4142
42- const resultEmbed = doc . resolveEmbed ( query ) ;
43+ const resultEmbed = doc . resolveEmbed ( query , { excludePrivateElements : ! searchPrivate } ) ;
4344
4445 const notFoundEmbed = doc . baseEmbed ( ) ;
4546 notFoundEmbed . description = "Didn't find any results for that query" ;
You can’t perform that action at this time.
0 commit comments