Skip to content

Commit

Permalink
feat: allow to pass custom map
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed Jul 28, 2024
1 parent edfe4d0 commit 0268ee6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gramio/prompt",
"version": "0.0.7",
"version": "0.1.0",
"description": "Prompt plugin for GramIO",
"main": "dist/index.cjs",
"module": "dist/index.js",
Expand Down Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"@types/bun": "^1.1.6",
"gramio": "^0.0.46",
"pkgroll": "^2.4.1",
"pkgroll": "2.4.0",
"typescript": "^5.5.4"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { type PromptsType, getPrompt, getWait } from "./utils.js";
* bot.start();
* ```
*/
export function prompt(): Plugin<
export function prompt(map?: PromptsType): Plugin<
// biome-ignore lint/complexity/noBannedTypes: Temporal fix slow types compiler
{},
import("gramio").DeriveDefinitions & {
Expand Down Expand Up @@ -219,7 +219,7 @@ export function prompt(): Plugin<
};
}
> {
const prompts: PromptsType = new Map();
const prompts: PromptsType = map ?? new Map();

return new Plugin("@gramio/prompt")
.derive(
Expand Down

0 comments on commit 0268ee6

Please sign in to comment.