Skip to content

Commit

Permalink
chore: reexport types
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed Aug 30, 2024
1 parent f3c5fad commit fe1b652
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gramio/prompt",
"version": "1.1.3",
"version": "1.1.4",
"description": "Prompt plugin for GramIO",
"main": "dist/index.cjs",
"module": "dist/index.js",
Expand Down
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import type {
PromptsType,
} from "./types.ts";

export * from "./types.ts";

/**
* Prompt plugin
* @example
Expand All @@ -36,7 +38,7 @@ import type {
* ```
*/
export function prompt<GlobalData = never>(options?: {
map?: PromptsType;
map?: PromptsType<GlobalData>;
defaults?: PromptFunctionParams<EventsUnion, GlobalData>;
}): Plugin<
// biome-ignore lint/complexity/noBannedTypes: Temporal fix slow types compiler
Expand Down Expand Up @@ -90,7 +92,8 @@ export function prompt<GlobalData = never>(options?: {
if (typeof prompt.onValidateError === "string")
return context.send(prompt.onValidateError);
// @ts-ignore
if (prompt.onValidateError) return prompt.onValidateError(context, prompt.actionReturn);
if (prompt.onValidateError)
return prompt.onValidateError(context, prompt.actionReturn);
if (prompt.text)
return context.send(prompt.text, prompt.sendParams);
return;
Expand Down

0 comments on commit fe1b652

Please sign in to comment.