1+ import { createDocsClient , type BlockGroup } from './svelte-docs' ;
2+ import { command } from 'jellycommands' ;
3+ import dedent from 'dedent' ;
14import {
25 ButtonStyle ,
36 ComponentType ,
@@ -8,9 +11,6 @@ import {
811 TextDisplayBuilder ,
912 userMention ,
1013} from 'discord.js' ;
11- import { createDocsClient , type BlockGroup } from './svelte-docs' ;
12- import { command } from 'jellycommands' ;
13- import dedent from 'dedent' ;
1414
1515const docs = await createDocsClient ( ) ;
1616
@@ -84,6 +84,14 @@ export default command({
8484 const query = interaction . options . getString ( 'query' , true ) ;
8585 const results = docs . search ( query ) ;
8686
87+ if ( ! results . length ) {
88+ await interaction . reply ( {
89+ flags : MessageFlags . Ephemeral ,
90+ content : 'No results found' ,
91+ } ) ;
92+ return ;
93+ }
94+
8795 const buttonPrefix = crypto . randomUUID ( ) ;
8896 const components = [ ] ;
8997
@@ -112,7 +120,7 @@ export default command({
112120 const response = await interaction . reply ( {
113121 flags : MessageFlags . IsComponentsV2 | MessageFlags . Ephemeral ,
114122 withResponse : true ,
115- components,
123+ components : components . slice ( 0 , 18 ) ,
116124 } ) ;
117125
118126 const button = await response . resource ?. message ?. awaitMessageComponent ( {
0 commit comments