telegram-botbuilder 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,14 +2,14 @@ import { BotBuilder } from "./bot-service";
2
2
  export type Action = (chat: number, _bot: BotBuilder, ...args: any[]) => Promise<void>;
3
3
  export interface Dialog {
4
4
  id: string;
5
- text: string | ((chat: number) => Promise<string>);
5
+ text: string | ((chat: number) => Promise<string>) | ((chat: number) => string);
6
6
  buttons: Button[][];
7
7
  }
8
8
  export interface BotDialog extends Dialog {
9
9
  buttons: BotButton[][];
10
10
  }
11
11
  export interface Button {
12
- text: string | ((chat: number) => Promise<string>);
12
+ text: string | ((chat: number) => Promise<string>) | ((chat: number) => string);
13
13
  action: Action[] | Action;
14
14
  }
15
15
  export interface BotButton extends Button {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-botbuilder",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "lib/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/src/bot-struct.ts CHANGED
@@ -5,7 +5,7 @@ export type Action = (chat: number, _bot: BotBuilder, ...args: any[]) => Promise
5
5
 
6
6
  export interface Dialog {
7
7
  id: string;
8
- text: string | ((chat: number) => Promise<string>);
8
+ text: string | ((chat: number) => Promise<string>) | ((chat: number) => string);
9
9
  buttons: Button[][]
10
10
  }
11
11
  export interface BotDialog extends Dialog {
@@ -13,7 +13,7 @@ export interface BotDialog extends Dialog {
13
13
  }
14
14
 
15
15
  export interface Button {
16
- text: string | ((chat: number) => Promise<string>);
16
+ text: string | ((chat: number) => Promise<string>) | ((chat: number) => string);
17
17
  action: Action[] | Action;
18
18
  }
19
19
  export interface BotButton extends Button {