Merge pull request #12 from MurzNN/fix-attachments

Refactored image url search, fixed url for link attachments
This commit is contained in:
Inex Code 2021-06-21 17:59:14 +03:00 committed by GitHub
commit 3ff0d8429d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -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;