We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey m8s.
@Scene(SceneNames.PAYMENT_SCENE) export class PaymentScene { @On('pre_checkout_query') public async onPreCheckout(@Ctx() ctx: Context) { console.log('pre checkout query', ctx); await ctx.answerPreCheckoutQuery(true); } @On('successful_payment') public onSuccessfulPayment(@Ctx() ctx: Context) { console.log('success', ctx); } }
This code doesn't work. But when I use bot.on, everything works:
bot.on
@Scene(SceneNames.PAYMENT_SCENE) export class PaymentScene { constructor(@InjectBot() bot: Telegraf<Context>) { super(); bot.on('pre_checkout_query', this.onPreCheckout.bind(this)); bot.on('successful_payment', this.onSuccessfulPayment.bind(this)); } public async onPreCheckout(ctx: Context) { console.log('pre checkout query', ctx); await ctx.answerPreCheckoutQuery(true); } public onSuccessfulPayment(ctx: Context) { console.log('success', ctx); } }
The text was updated successfully, but these errors were encountered:
@justmavi telegraf/telegraf#1863 (comment)
Sorry, something went wrong.
No branches or pull requests
Hey m8s.
This code doesn't work.
But when I use
bot.on
, everything works:The text was updated successfully, but these errors were encountered: