music: attachment support
This commit is contained in:
parent
aa960f0c00
commit
d2b48d997d
1 changed files with 9 additions and 1 deletions
|
|
@ -397,7 +397,15 @@ command.callback = async function (msg, line) {
|
||||||
type = "sc";
|
type = "sc";
|
||||||
} else if (REGEX_FILE.test(argStr)) {
|
} else if (REGEX_FILE.test(argStr)) {
|
||||||
type = "file";
|
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 (type != null) {
|
||||||
if (playlist) {
|
if (playlist) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue