diff --git a/src/commands/search.ts b/src/commands/search.ts index 59afbed..69fc5f0 100644 --- a/src/commands/search.ts +++ b/src/commands/search.ts @@ -35,7 +35,12 @@ export async function execute(interaction: ChatInputCommandInteraction) { (match as MatchType) ?? undefined ); const response = results.length - ? results.map(({ word, meaning }) => `${word}: ${meaning}`).join('\n') + ? results + .map( + ({ word, meaning, extra, type }) => + `${word} (${type}): ${meaning} ${extra?.join(' ') ?? ''}` + ) + .join('\n') : 'No results found.'; await interaction.editReply( response.length > 2000 diff --git a/src/lib/kumilinwa/types.ts b/src/lib/kumilinwa/types.ts index 2d5a49b..c12d9b3 100644 --- a/src/lib/kumilinwa/types.ts +++ b/src/lib/kumilinwa/types.ts @@ -1,9 +1,17 @@ +export interface Section { + title?: string; + type: WordType; + headers: string[]; + entries: Entry[]; +} + /** * The type of the entry in each separated file (i.e. verbs.json) */ export interface Entry { word: string; meaning: string; + extra?: string[]; } /**