Merge pull request #12 from MurzNN/fix-attachments
Refactored image url search, fixed url for link attachments
This commit is contained in:
commit
3ff0d8429d
12
src/vk.ts
12
src/vk.ts
|
@ -573,7 +573,7 @@ export class VkPuppet {
|
|||
}
|
||||
} catch (err) {
|
||||
const opts: IMessageEvent = {
|
||||
body: `Image was sent: ${f["largeSizeUrl"]}`,
|
||||
body: `Image: ${f["image"]["largeSizeUrl"]}`,
|
||||
};
|
||||
await this.puppet.sendMessage(params, opts);
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ export class VkPuppet {
|
|||
: await this.puppet.sendFileDetect(params, f["imagesWithBackground"][4]["url"]);
|
||||
} catch (err) {
|
||||
const opts: IMessageEvent = {
|
||||
body: `Sticker was sent: ${f["imagesWithBackground"][4]["url"]}`,
|
||||
body: `Sticker: ${f["imagesWithBackground"][4]["url"]}`,
|
||||
};
|
||||
await this.puppet.sendMessage(params, opts);
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ export class VkPuppet {
|
|||
await this.puppet.sendAudio(params, f["oggUrl"]);
|
||||
} catch (err) {
|
||||
const opts: IMessageEvent = {
|
||||
body: `Audio message was sent: ${f["url"]}`,
|
||||
body: `Audio message: ${f["url"]}`,
|
||||
};
|
||||
await this.puppet.sendMessage(params, opts);
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ export class VkPuppet {
|
|||
await this.puppet.sendAudio(params, f["url"]);
|
||||
} catch (err) {
|
||||
const opts: IMessageEvent = {
|
||||
body: `Music was sent: ${f["title"]} by ${f["artist"]} ${f["url"]}`,
|
||||
body: `Audio: ${f["title"]} by ${f["artist"]} ${f["url"]}`,
|
||||
};
|
||||
await this.puppet.sendMessage(params, opts);
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ export class VkPuppet {
|
|||
: await this.puppet.sendFileDetect(params, f["url"], f["title"]);
|
||||
} catch (err) {
|
||||
const opts: IMessageEvent = {
|
||||
body: `Document was sent: ${f["url"]}`,
|
||||
body: `Document: ${f["url"]}`,
|
||||
};
|
||||
await this.puppet.sendMessage(params, opts);
|
||||
}
|
||||
|
@ -627,7 +627,7 @@ export class VkPuppet {
|
|||
|
||||
case AttachmentType.LINK:
|
||||
await this.puppet.sendMessage(params, {
|
||||
body: `Link was sent: ${f["url"]}`,
|
||||
body: `Link: ${f["link"]["url"]}`,
|
||||
});
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue