ts-telegraf-decorators
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -20,26 +20,26 @@ "use strict"; | ||
} | ||
WizardController2.prototype.hello = function (ctx) { | ||
WizardController2.prototype.hello1 = function (ctx) { | ||
console.log('step 2 1'); | ||
return ctx.wizard.next(); | ||
}; | ||
WizardController2.prototype.hello2 = function (ctx) { | ||
WizardController2.prototype.hello22 = function (ctx) { | ||
console.log('step 2 2'); | ||
return ctx.wizard.next(); | ||
}; | ||
WizardController2.prototype.hello3 = function (ctx) { | ||
WizardController2.prototype.hello33 = function (ctx) { | ||
console.log('step 2 3'); | ||
return ctx.wizard.next(); | ||
}; | ||
WizardController2.prototype.hello4 = function (ctx) { | ||
WizardController2.prototype.hello44 = function (ctx) { | ||
console.log('step 2 3'); | ||
return ctx.wizard.next(); | ||
}; | ||
WizardController2.prototype.hello5 = function (ctx) { | ||
WizardController2.prototype.hello55 = function (ctx) { | ||
console.log('step 2 3'); | ||
return ctx.scene.leave(); | ||
}; | ||
WizardController2.prototype.exit = function (ctx) { | ||
WizardController2.prototype.exitt = function (ctx) { | ||
return ctx.scene.leave(); | ||
}; | ||
WizardController2.prototype.leave = function (ctx) { | ||
WizardController2.prototype.leavee = function (ctx) { | ||
console.log('Leave 2'); | ||
@@ -53,3 +53,3 @@ }; | ||
__metadata("design:returntype", void 0) | ||
], WizardController2.prototype, "hello", null); | ||
], WizardController2.prototype, "hello1", null); | ||
__decorate([ | ||
@@ -61,3 +61,3 @@ src_1.TFWizardStep(2), | ||
__metadata("design:returntype", void 0) | ||
], WizardController2.prototype, "hello2", null); | ||
], WizardController2.prototype, "hello22", null); | ||
__decorate([ | ||
@@ -70,3 +70,3 @@ src_1.TFWizardStep(3), | ||
__metadata("design:returntype", void 0) | ||
], WizardController2.prototype, "hello3", null); | ||
], WizardController2.prototype, "hello33", null); | ||
__decorate([ | ||
@@ -79,3 +79,3 @@ src_1.TFWizardStep(3), | ||
__metadata("design:returntype", void 0) | ||
], WizardController2.prototype, "hello4", null); | ||
], WizardController2.prototype, "hello44", null); | ||
__decorate([ | ||
@@ -88,3 +88,3 @@ src_1.TFWizardStep(3), | ||
__metadata("design:returntype", void 0) | ||
], WizardController2.prototype, "hello5", null); | ||
], WizardController2.prototype, "hello55", null); | ||
__decorate([ | ||
@@ -96,3 +96,3 @@ src_1.Command('exit'), | ||
__metadata("design:returntype", void 0) | ||
], WizardController2.prototype, "exit", null); | ||
], WizardController2.prototype, "exitt", null); | ||
__decorate([ | ||
@@ -104,3 +104,3 @@ src_1.Leave(), | ||
__metadata("design:returntype", void 0) | ||
], WizardController2.prototype, "leave", null); | ||
], WizardController2.prototype, "leavee", null); | ||
WizardController2 = __decorate([ | ||
@@ -107,0 +107,0 @@ src_1.TFWizard('steps2') |
@@ -76,2 +76,3 @@ "use strict"; | ||
.wizardStep | ||
.filter(function (value) { return wizard.target.prototype == value.target; }) | ||
.sort(function (a, b) { return a.step - b.step; }) | ||
@@ -78,0 +79,0 @@ .reduce(function (r, a) { |
@@ -187,3 +187,2 @@ "use strict"; | ||
return function (target, propertyKey, descriptor) { | ||
console.log(propertyKey); | ||
MetadataStorage_1.MetadataArgsStorage.handlers.push({ | ||
@@ -190,0 +189,0 @@ propertyName: propertyKey, |
export declare class WizardController2 { | ||
hello(ctx: any): any; | ||
hello2(ctx: any): any; | ||
hello3(ctx: any): any; | ||
hello4(ctx: any): any; | ||
hello5(ctx: any): any; | ||
exit(ctx: any): any; | ||
leave(ctx: any): void; | ||
hello1(ctx: any): any; | ||
hello22(ctx: any): any; | ||
hello33(ctx: any): any; | ||
hello44(ctx: any): any; | ||
hello55(ctx: any): any; | ||
exitt(ctx: any): any; | ||
leavee(ctx: any): void; | ||
} |
{ | ||
"name": "ts-telegraf-decorators", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"author": "Ivan Surkov <panarama360@gmail.com>", | ||
@@ -5,0 +5,0 @@ "main": "build/src/index.js", |
@@ -8,3 +8,3 @@ import {Command, Hears, Leave, TFContext, TFWizard, TFWizardStep} from "../../src"; | ||
@TFWizardStep(1) | ||
hello(@TFContext() ctx) { | ||
hello1(@TFContext() ctx) { | ||
console.log('step 2 1'); | ||
@@ -15,3 +15,3 @@ return ctx.wizard.next(); | ||
@TFWizardStep(2) | ||
hello2(@TFContext() ctx) { | ||
hello22(@TFContext() ctx) { | ||
console.log('step 2 2'); | ||
@@ -23,3 +23,3 @@ return ctx.wizard.next(); | ||
@Hears('hello') | ||
hello3(@TFContext() ctx) { | ||
hello33(@TFContext() ctx) { | ||
console.log('step 2 3'); | ||
@@ -31,3 +31,3 @@ return ctx.wizard.next(); | ||
@Command('test') | ||
hello4(@TFContext() ctx) { | ||
hello44(@TFContext() ctx) { | ||
console.log('step 2 3'); | ||
@@ -39,3 +39,3 @@ return ctx.wizard.next(); | ||
@Command('hello') | ||
hello5(@TFContext() ctx) { | ||
hello55(@TFContext() ctx) { | ||
console.log('step 2 3') | ||
@@ -46,3 +46,3 @@ return ctx.scene.leave(); | ||
@Command('exit') | ||
exit(@TFContext() ctx) { | ||
exitt(@TFContext() ctx) { | ||
return ctx.scene.leave(); | ||
@@ -52,5 +52,5 @@ } | ||
@Leave() | ||
leave(@TFContext() ctx) { | ||
leavee(@TFContext() ctx) { | ||
console.log('Leave 2'); | ||
} | ||
} |
@@ -72,2 +72,3 @@ import {IBotOptions} from "./interfaces/IBotOptions"; | ||
.wizardStep | ||
.filter(value => wizard.target.prototype == value.target) | ||
.sort((a, b) => a.step - b.step) | ||
@@ -80,3 +81,2 @@ .reduce(function (r, a) { | ||
const steps = Object.values(group) | ||
@@ -89,3 +89,3 @@ .map((stepsMetadata: WizardMetadata[], index) => { | ||
.handlers | ||
.filter(value => value.target == wizard.target.prototype && value.propertyName == stepMethod.propertyName) | ||
.filter(value => value.target == wizard.target.prototype && value.propertyName == stepMethod.propertyName); | ||
if (handlers.length) { | ||
@@ -92,0 +92,0 @@ handlers.forEach(handler => { |
@@ -188,3 +188,2 @@ import * as tt from "telegraf/typings/telegram-types"; | ||
return function (target: Object, propertyKey: string, descriptor: PropertyDescriptor) { | ||
console.log(propertyKey) | ||
MetadataArgsStorage.handlers.push({ | ||
@@ -191,0 +190,0 @@ propertyName: propertyKey, |
96114