bugfix
This commit is contained in:
parent
9c152b18ee
commit
45a9d8e880
2 changed files with 7 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ import { GlobalCommands } from './global-commands';
|
||||||
import {Inject, Logger} from "@nestjs/common";
|
import {Inject, Logger} from "@nestjs/common";
|
||||||
import AppConsts from "../constants";
|
import AppConsts from "../constants";
|
||||||
import {ClientProxy} from "@nestjs/microservices";
|
import {ClientProxy} from "@nestjs/microservices";
|
||||||
import {catchError} from "rxjs";
|
import {catchError, of} from "rxjs";
|
||||||
import {TGHandlers} from "./handlers";
|
import {TGHandlers} from "./handlers";
|
||||||
|
|
||||||
@Update()
|
@Update()
|
||||||
|
|
@ -41,9 +41,13 @@ export class BotUpdate {
|
||||||
this.gameService.send({cmd: 'GuestInfo'}, {user: ctx.from.id})
|
this.gameService.send({cmd: 'GuestInfo'}, {user: ctx.from.id})
|
||||||
.pipe(catchError((val) => {
|
.pipe(catchError((val) => {
|
||||||
console.log(val);
|
console.log(val);
|
||||||
return 'Error';
|
ctx.reply('500: что-то отъебало');
|
||||||
|
return of("Error");
|
||||||
}),)
|
}),)
|
||||||
.subscribe(async (result) => {
|
.subscribe(async (result) => {
|
||||||
|
if(result === "Error") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (result) {
|
if (result) {
|
||||||
await ctx.reply(
|
await ctx.reply(
|
||||||
`🤟 Все путем, ты уже зарегистрирован, расслабься и жди указаний\r\nМожет быть`,
|
`🤟 Все путем, ты уже зарегистрирован, расслабься и жди указаний\r\nМожет быть`,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export class TGHandlers {
|
||||||
if(data) {
|
if(data) {
|
||||||
gameService.emit({ cmd: 'ApplyDebuff'}, { ...ctx.callbackQuery, from: ctx.from.id });
|
gameService.emit({ cmd: 'ApplyDebuff'}, { ...ctx.callbackQuery, from: ctx.from.id });
|
||||||
await ctx.editMessageReplyMarkup(undefined);
|
await ctx.editMessageReplyMarkup(undefined);
|
||||||
await ctx.editMessageText(ctx.update.callback_query.data);
|
await ctx.editMessageText("карта выбрана");
|
||||||
}
|
}
|
||||||
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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue