1
0
Fork 0
mirror of https://github.com/muerwre/vk-tg-bot.git synced 2025-04-25 06:56:40 +07:00

#4 working likes on posts

This commit is contained in:
Fedor Katurov 2021-05-05 14:24:16 +07:00
parent a6e6209770
commit 5535a36cb8
6 changed files with 190 additions and 59 deletions

View file

@ -51,12 +51,35 @@ export class VkEventHandler<
/**
* Checks for duplicates
*/
getEvent = async (id?: number): Promise<Event | undefined> => {
getEventById = async (id?: number): Promise<Event | undefined> => {
if (!id) {
return undefined;
}
return await this.db.getEvent(this.type, id, this.group.id, this.channel);
return await this.db.getEventById(
this.type,
id,
this.group.id,
this.channel
);
};
/**
* Checks for duplicates
*/
getEventByTgMessageId = async (
tgMessageId?: number
): Promise<Event | undefined> => {
if (!tgMessageId) {
return undefined;
}
return await this.db.getEventByMessageId(
this.type,
tgMessageId,
this.group.id,
this.channel
);
};
/**