Handle creation of chats with groups, closes #7
This commit is contained in:
parent
0d0a98490c
commit
fd02432559
12
src/vk.ts
12
src/vk.ts
|
@ -100,6 +100,7 @@ export class VkPuppet {
|
||||||
name: `${userInfo[0].first_name} ${userInfo[0].last_name}`,
|
name: `${userInfo[0].first_name} ${userInfo[0].last_name}`,
|
||||||
avatarUrl: userInfo[0].photo_max,
|
avatarUrl: userInfo[0].photo_max,
|
||||||
isDirect: true,
|
isDirect: true,
|
||||||
|
externalUrl: `https://vk.com/id${info.items[0].peer.id}}`,
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -113,6 +114,17 @@ export class VkPuppet {
|
||||||
};
|
};
|
||||||
break;
|
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:
|
default:
|
||||||
response = {
|
response = {
|
||||||
puppetId,
|
puppetId,
|
||||||
|
|
Loading…
Reference in a new issue