mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-25 15:06:41 +07:00
added working vk event handlers
This commit is contained in:
parent
3f908da91e
commit
12c8e30a1e
8 changed files with 184 additions and 15 deletions
|
@ -56,7 +56,8 @@ export class HttpApi {
|
|||
this.app.get(url.pathname, this.testWebhook);
|
||||
}
|
||||
|
||||
this.app.post(this.vk.endpoint, this.handleVkEvent);
|
||||
// VK event handler
|
||||
this.app.post(this.vk.endpoint, this.vk.handle);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,12 +74,4 @@ export class HttpApi {
|
|||
private testWebhook = async (req: Request, res: Response) => {
|
||||
res.sendStatus(200);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles VK events
|
||||
*/
|
||||
private handleVkEvent = async (req: Request, res: Response) => {
|
||||
await this.vk.handle(req.body);
|
||||
res.sendStatus(200);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue