({
command,
callback,
options = {},
result,
providesPreview = false,
previewer,
previewCallback,
appId,
description = '',
}: ISlashCommandAddParams<T>)
| 24 | export const slashCommands = { |
| 25 | commands: {} as Record<string, SlashCommand>, |
| 26 | add<T extends string>({ |
| 27 | command, |
| 28 | callback, |
| 29 | options = {}, |
| 30 | result, |
| 31 | providesPreview = false, |
| 32 | previewer, |
| 33 | previewCallback, |
| 34 | appId, |
| 35 | description = '', |
| 36 | }: ISlashCommandAddParams<T>): void { |
| 37 | if (this.commands[command]) { |
| 38 | return; |
| 39 | } |
| 40 | this.commands[command] = { |
| 41 | command, |
| 42 | callback, |
| 43 | params: options.params, |
| 44 | description: options.description || description, |
| 45 | permission: options.permission, |
| 46 | clientOnly: options.clientOnly || false, |
| 47 | result, |
| 48 | providesPreview: Boolean(providesPreview), |
| 49 | previewer, |
| 50 | previewCallback, |
| 51 | appId, |
| 52 | } as SlashCommand; |
| 53 | }, |
| 54 | async run({ |
| 55 | command, |
| 56 | message, |
nothing calls this directly
no outgoing calls
no test coverage detected