forgorRrRR

This commit is contained in:
ChomeNS 2023-02-28 14:21:14 +07:00
parent 33f03675fb
commit 76302ea658

View file

@ -47,7 +47,6 @@ async function play (bot, values, discord, channeldc, selector, config) {
bot.music.queue.push(song)
bot.music.play(song)
} catch (e) {
bot.console.error(e.stack)
if (discord) {
const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error)
@ -71,6 +70,8 @@ async function playUrl (bot, values, discord, channeldc, selector, config) {
responseType: 'arraybuffer'
})
song = await bot.music.load(response.data, getFilenameFromUrl(url))
if (discord) {
const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal)
@ -81,7 +82,6 @@ async function playUrl (bot, values, discord, channeldc, selector, config) {
bot.tellraw(selector, [{ text: 'Added ', color: 'white' }, { text: song.name, color: 'gold' }, { text: ' to the song queue', color: 'white' }])
}
song = await bot.music.load(response.data, getFilenameFromUrl(url))
bot.music.queue.push(song)
bot.music.play(song)
} catch (_err) {
@ -168,8 +168,7 @@ module.exports = {
alias: [],
trusted: 0,
usage: [
'play <song>',
'playurl <url>',
'play <song|url>',
'stop',
'loop <all|current|off>',
'list [directory]',
@ -180,10 +179,12 @@ module.exports = {
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
switch (args[0]) {
case 'play':
play(bot, args.slice(1), false, null, selector, config)
break
case 'playurl':
playUrl(bot, args.slice(1), false, null, selector, config)
case 'playurl': // deprecated
if (args.slice(1).startsWith('http')) {
playUrl(bot, args.slice(1), false, null, selector, config)
} else {
play(bot, args.slice(1), false, null, selector, config)
}
break
case 'stop':
try {