music: attachment support

This commit is contained in:
Cynthia Foxwell 2022-04-18 22:56:30 -06:00
parent aa960f0c00
commit d2b48d997d
1 changed files with 9 additions and 1 deletions

View File

@ -397,7 +397,15 @@ command.callback = async function (msg, line) {
type = "sc";
} else if (REGEX_FILE.test(argStr)) {
type = "file";
} else if
} else if (msg.attachments.length > 0) {
const entries = msg.attachments.filter((attachment) =>
REGEX_FILE.test(attachment.url)
);
if (entries.length > 0) {
type = "file";
argStr = entries[0].url;
}
}
if (type != null) {
if (playlist) {