mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-25 06:56:40 +07:00
#1 added buttons to MessageNewHandler.ts
This commit is contained in:
parent
eb6a645ad3
commit
b35b5d3731
4 changed files with 73 additions and 12 deletions
|
@ -25,4 +25,23 @@ export class VkEventHandler<
|
|||
console.log(`vk received unknown event`, ctx);
|
||||
await next();
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetches user by id
|
||||
* @param id
|
||||
*/
|
||||
protected getUserByID = async (id: string) => {
|
||||
const users = await this.instance.api.users.get({
|
||||
user_ids: [id],
|
||||
fields: ["sex"],
|
||||
});
|
||||
|
||||
return users[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns url for group dialog
|
||||
*/
|
||||
protected makeDialogUrl = (groupId: number, userId: number): string =>
|
||||
`https://vk.com/gim${groupId}?sel=${userId}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue