mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 05:42:57 -04:00
make audio work with argument
This commit is contained in:
parent
b676182d86
commit
c341c8bbd3
1 changed files with 9 additions and 6 deletions
|
@ -23,15 +23,18 @@ module.exports = {
|
|||
permissionsClient: [...PERMISSION_GROUPS.baseline],
|
||||
run: async (context) => {
|
||||
await acknowledge(context);
|
||||
|
||||
if (!context.message.messageReference) return editOrReply(context, createEmbed("warning", context, "You need to reply to a message containing a song link."))
|
||||
|
||||
try {
|
||||
let msg;
|
||||
try {
|
||||
msg = await context.message.channel.fetchMessage(context.message.messageReference.messageId)
|
||||
} catch (e) {
|
||||
return editOrReply(context, createEmbed("error", context, "Unable to fetch message."))
|
||||
if (!context.message.messageReference) msg = context.message;
|
||||
else {
|
||||
try {
|
||||
msg = await context.message.channel.fetchMessage(context.message.messageReference.messageId)
|
||||
} catch (e) {
|
||||
return editOrReply(context, createEmbed("error", context, "Unable to fetch message."))
|
||||
}
|
||||
}
|
||||
|
||||
let urls = msg.content.match(urlr)
|
||||
if(msg.messageSnapshots?.length >= 1) urls = msg.messageSnapshots.first().message.content.match(urlr);
|
||||
if (urls) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue