bugfix
This commit is contained in:
parent
d34304e6bf
commit
e151e5c285
3 changed files with 16 additions and 3 deletions
|
|
@ -101,7 +101,10 @@ export class BotUpdate {
|
||||||
|
|
||||||
@On('callback_query')
|
@On('callback_query')
|
||||||
async onInlineQuery(@Ctx() ctx: any) {
|
async onInlineQuery(@Ctx() ctx: any) {
|
||||||
await TGHandlers.handleCallback(ctx, this.logger, this.gameService);
|
try {
|
||||||
|
await TGHandlers.handleCallback(ctx, this.logger, this.gameService);
|
||||||
|
} catch (err) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Hears(Messages.CHANGE_PHOTO)
|
@Hears(Messages.CHANGE_PHOTO)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,12 @@ export class TGHandlers {
|
||||||
if(ctx.update.callback_query.message.text.indexOf('Внимание') !== -1) {
|
if(ctx.update.callback_query.message.text.indexOf('Внимание') !== -1) {
|
||||||
const answer =ctx.update.callback_query.data;
|
const answer =ctx.update.callback_query.data;
|
||||||
gameService.emit({ cmd: "QuestionAnswer"}, { user: ctx.from.id, answer: answer, name: ctx.from.first_name });
|
gameService.emit({ cmd: "QuestionAnswer"}, { user: ctx.from.id, answer: answer, name: ctx.from.first_name });
|
||||||
await ctx.editMessageReplyMarkup(undefined);
|
try {
|
||||||
|
await ctx.editMessageReplyMarkup(undefined);
|
||||||
|
} catch (err) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
await ctx.editMessageText("ответ принят!");
|
await ctx.editMessageText("ответ принят!");
|
||||||
} else if(ctx.update.callback_query.data.startsWith('card/')) {
|
} else if(ctx.update.callback_query.data.startsWith('card/')) {
|
||||||
const cardtoplay = ctx.update.callback_query.data.substring('card/'.length);
|
const cardtoplay = ctx.update.callback_query.data.substring('card/'.length);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,12 @@ export class QuizScene {
|
||||||
|
|
||||||
@On('callback_query')
|
@On('callback_query')
|
||||||
async onInlineQuery(@Ctx() ctx: Context) {
|
async onInlineQuery(@Ctx() ctx: Context) {
|
||||||
await TGHandlers.handleCallback(ctx, this.logger, this.gameService);
|
try {
|
||||||
|
await TGHandlers.handleCallback(ctx, this.logger, this.gameService);
|
||||||
|
|
||||||
|
}catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@On('text')
|
@On('text')
|
||||||
async onText(@Message('text') text: string, @Ctx() ctx: Context) {
|
async onText(@Message('text') text: string, @Ctx() ctx: Context) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue