mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-24 22:46:41 +07:00
#6 added more loggers
This commit is contained in:
parent
37b0bf13be
commit
2feae715f0
2 changed files with 3 additions and 2 deletions
|
@ -30,7 +30,7 @@ export class MessageNewHandler extends VkEventHandler<Fields, Values> {
|
||||||
|
|
||||||
const user = await this.getUserByID(String(context.senderId));
|
const user = await this.getUserByID(String(context.senderId));
|
||||||
|
|
||||||
logger.debug(
|
logger.info(
|
||||||
`vk, group ${this.group.name} received message from ${user.first_name} ${user.last_name}: "${context.text}"`
|
`vk, group ${this.group.name} received message from ${user.first_name} ${user.last_name}: "${context.text}"`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { TelegramService } from "../../telegram";
|
||||||
import { Template } from "../../template";
|
import { Template } from "../../template";
|
||||||
import { Storage } from "../../db";
|
import { Storage } from "../../db";
|
||||||
import { Event } from "../../db/postgres/entities/Event";
|
import { Event } from "../../db/postgres/entities/Event";
|
||||||
|
import logger from "../../logger";
|
||||||
|
|
||||||
export class VkEventHandler<
|
export class VkEventHandler<
|
||||||
F extends Record<string, any> = any,
|
F extends Record<string, any> = any,
|
||||||
|
@ -25,7 +26,7 @@ export class VkEventHandler<
|
||||||
context: any,
|
context: any,
|
||||||
next: NextMiddleware
|
next: NextMiddleware
|
||||||
) => Promise<void> = async (ctx, next) => {
|
) => Promise<void> = async (ctx, next) => {
|
||||||
console.log(`vk received unknown event`, ctx);
|
logger.warn(`vk received unknown event`, ctx);
|
||||||
await next();
|
await next();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue