From eed568a68182490a8ef769e7caa196f19b000437 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Fri, 22 Jan 2021 20:29:41 +0000 Subject: [PATCH] Add music from VK handler --- src/vk.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vk.ts b/src/vk.ts index d6fb218..760309d 100755 --- a/src/vk.ts +++ b/src/vk.ts @@ -581,6 +581,16 @@ export class VkPuppet { await this.puppet.sendMessage(params, opts); } break; + case AttachmentType.AUDIO: + try { + await this.puppet.sendAudio(params, f["url"]); + } catch (err) { + const opts: IMessageEvent = { + body: `Music was sent: ${f["title"]} by ${f["artist"]} ${f["url"]}`, + }; + await this.puppet.sendMessage(params, opts); + } + break; case AttachmentType.DOCUMENT: try { p.data.isUserToken ? await this.puppet.sendFileDetect(params, f["doc"]["url"], f["doc"]["title"])