Handle creation of chats with groups, closes #7

This commit is contained in:
Inex Code 2021-02-13 11:19:00 +00:00
parent 0d0a98490c
commit fd02432559

View file

@ -100,6 +100,7 @@ export class VkPuppet {
name: `${userInfo[0].first_name} ${userInfo[0].last_name}`,
avatarUrl: userInfo[0].photo_max,
isDirect: true,
externalUrl: `https://vk.com/id${info.items[0].peer.id}}`,
};
break;
@ -113,6 +114,17 @@ export class VkPuppet {
};
break;
case "group":
const groupInfo = await p.client.api.groups.getById({ group_id: info.items[0].peer.id });
response = {
puppetId,
roomId: peerId.toString(),
name: groupInfo[0].name || peerId.toString(),
avatarUrl: groupInfo[0]?.photo_200,
externalUrl: `https://vk.com/${groupInfo[0].screen_name}`,
};
break;
default:
response = {
puppetId,