telegram-botbuilder 1.1.0 → 1.1.2

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.
@@ -24,6 +24,6 @@ export declare class BotBuilder {
24
24
  Message(chat: number, content: string): Promise<TelegramBot.Message>;
25
25
  }
26
26
  export declare function ChangeDialog(id: string): Action;
27
- export declare function CallbackAction(descriptor: string): Action;
27
+ export declare function CallbackAction(descriptor: string, ...args: any[]): Action;
28
28
  export declare function WaitForData(descriptor: string): Action;
29
29
  export {};
@@ -322,7 +322,7 @@ var BotBuilder = /** @class */ (function () {
322
322
  return [3 /*break*/, 1];
323
323
  case 8:
324
324
  if (dialog == undefined)
325
- markup = [[{ text: "Меню", callback_data: this._schema.start }]];
325
+ markup = [[{ text: "Меню", callback_data: this._schema.start }]]; // FIX RAND BTN
326
326
  if (!(typeof (dialog === null || dialog === void 0 ? void 0 : dialog.text) === 'function')) return [3 /*break*/, 10];
327
327
  return [4 /*yield*/, (dialog === null || dialog === void 0 ? void 0 : dialog.text(chat))];
328
328
  case 9:
@@ -366,13 +366,17 @@ function ChangeDialog(id) {
366
366
  return function (chat, _bot) { return _bot.ChangeDialog(chat, id); };
367
367
  }
368
368
  function CallbackAction(descriptor) {
369
+ var args = [];
370
+ for (var _i = 1; _i < arguments.length; _i++) {
371
+ args[_i - 1] = arguments[_i];
372
+ }
369
373
  return function (chat, _bot) {
370
374
  var _a;
371
- var args = [];
375
+ var _args = [];
372
376
  for (var _i = 2; _i < arguments.length; _i++) {
373
- args[_i - 2] = arguments[_i];
377
+ _args[_i - 2] = arguments[_i];
374
378
  }
375
- (_a = _bot.ActionSystem).emit.apply(_a, __spreadArray([descriptor, chat], args, false));
379
+ (_a = _bot.ActionSystem).emit.apply(_a, __spreadArray(__spreadArray([descriptor, chat], args, false), _args, false));
376
380
  };
377
381
  }
378
382
  function WaitForData(descriptor) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-botbuilder",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "main": "lib/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/readme.md CHANGED
@@ -42,7 +42,7 @@ const schema: Schema = {
42
42
  ],
43
43
  };
44
44
 
45
- const bot = new BotBuilder(schema, 'YOUR_BOT_TOKEN');
45
+ const bot = new BotBuilder(schema, 'YOUR_BOT_TOKEN', { polling: true });
46
46
 
47
47
  bot.ActionSystem.on('button1_clicked', (chatid: number) => {
48
48
  bot.Message(chatid, 'Button1 Click!');
@@ -188,8 +188,8 @@ export class BotBuilder {
188
188
  export function ChangeDialog(id: string): Action {
189
189
  return (chat: number, _bot: BotBuilder) => { return _bot.ChangeDialog(chat, id); };
190
190
  }
191
- export function CallbackAction(descriptor: string): Action {
192
- return (chat: number, _bot: BotBuilder, ...args: any[]) => { _bot.ActionSystem.emit(descriptor, chat, ...args); };
191
+ export function CallbackAction(descriptor: string, ...args: any[]): Action {
192
+ return (chat: number, _bot: BotBuilder, ..._args: any[]) => { _bot.ActionSystem.emit(descriptor, chat, ...args, ..._args); };
193
193
  }
194
194
  export function WaitForData(descriptor: string): Action {
195
195
  return (chat: number, _bot: BotBuilder) => {