Skip to content

Commit 7b3db9c

Browse files
author
Akhil Pillai
committed
Update to use new langspec types
1 parent f5251d1 commit 7b3db9c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/commands/search.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ export async function execute(interaction: ChatInputCommandInteraction) {
3535
(match as MatchType) ?? undefined
3636
);
3737
const response = results.length
38-
? results.map(({ word, meaning }) => `${word}: ${meaning}`).join('\n')
38+
? results
39+
.map(
40+
({ word, meaning, extra, type }) =>
41+
`${word} (${type}): ${meaning} ${extra?.join(' ') ?? ''}`
42+
)
43+
.join('\n')
3944
: 'No results found.';
4045
await interaction.editReply(
4146
response.length > 2000

src/lib/kumilinwa/types.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
export interface Section {
2+
title?: string;
3+
type: WordType;
4+
headers: string[];
5+
entries: Entry[];
6+
}
7+
18
/**
29
* The type of the entry in each separated file (i.e. verbs.json)
310
*/
411
export interface Entry {
512
word: string;
613
meaning: string;
14+
extra?: string[];
715
}
816

917
/**

0 commit comments

Comments
 (0)