Skip to content

Commit ddf520e

Browse files
committed
feat: Add shared docs command types
1 parent 1adba44 commit ddf520e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

src/commands/docs/types.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import type {
2+
ActionRowBuilder,
3+
Collection,
4+
EmbedBuilder,
5+
MessageActionRowComponentBuilder,
6+
} from 'discord.js';
7+
8+
export type ActionBuilders = {
9+
selectRow: ActionRowBuilder<MessageActionRowComponentBuilder>;
10+
buttonRow: ActionRowBuilder<MessageActionRowComponentBuilder>;
11+
};
12+
13+
export type ProviderConfig<Item = unknown> = {
14+
color: number;
15+
icon: string;
16+
commandDescription: string;
17+
directUrl?: string;
18+
19+
getFilteredData: (query: string) => Promise<Item[]> | Item[];
20+
21+
createCollection: (items: Array<Item>) => Collection<string, Item>;
22+
23+
createActionBuilders: (data: Collection<string, Item>) => ActionBuilders;
24+
25+
// Create result embeds to show after selection
26+
createResultEmbeds: (data: Collection<string, Item>) => EmbedBuilder | EmbedBuilder[];
27+
28+
// Get display title for an item
29+
getDisplayTitle: (item: Item) => string;
30+
31+
// Get selection content message
32+
getSelectionMessage: (query: string) => string;
33+
34+
// Get display message after selection
35+
getDisplayMessage: (selectedTitles: string[]) => string;
36+
};

0 commit comments

Comments
 (0)