Add music from VK handler

This commit is contained in:
Inex Code 2021-01-22 20:29:41 +00:00
parent ca0ea310a4
commit eed568a681
1 changed files with 10 additions and 0 deletions

View File

@ -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"])