diff --git a/commands/draw.js b/commands/draw.js index 6252460..7ba5ca0 100644 --- a/commands/draw.js +++ b/commands/draw.js @@ -9,10 +9,11 @@ module.exports = { trusted: 0, usage: '', execute: async function (bot, username, sender, prefix, args, config, hash, ownerhash, selector) { + let image try { const url = args.join(' ') - const image = await axios.get('https://http-proxy.nongsonchome.repl.co', { + image = await axios.get('https://http-proxy.nongsonchome.repl.co', { params: { uri: url }, @@ -32,8 +33,9 @@ module.exports = { .toBuffer({ resolveWithObject: true }) bot.draw(data, info) - } catch (e) { - bot.tellraw(selector, { text: 'SyntaxError: Invalid URL', color: 'red' }) + } catch (_err) { + const e = image.data.toString() + bot.tellraw(selector, { text: e, color: 'red' }) } } } diff --git a/commands/music.js b/commands/music.js index 51c02be..70f4b8e 100644 --- a/commands/music.js +++ b/commands/music.js @@ -48,9 +48,10 @@ async function play (bot, values, discord, channeldc, selector, config) { } async function playUrl (bot, values, discord, channeldc, selector, config) { + let response try { const url = values.join(' ') - const response = await axios.get('https://http-proxy.nongsonchome.repl.co', { + response = await axios.get('https://http-proxy.nongsonchome.repl.co', { params: { uri: url }, @@ -68,15 +69,16 @@ async function playUrl (bot, values, discord, channeldc, selector, config) { } else { bot.tellraw(selector, [{ text: 'Added ', color: 'white' }, { text: song.name, color: 'gold' }, { text: ' to the song queue', color: 'white' }]) } - } catch (e) { + } catch (_err) { + const e = response.data.toString() if (discord) { const Embed = new MessageEmbed() .setColor(config.discord.embedsColors.error) .setTitle('Error') - .setDescription('```SyntaxError: Invalid URL```') + .setDescription(`\`\`\`${e}\`\`\``) channeldc.send({ embeds: [Embed] }) } else { - bot.tellraw(selector, { text: 'SyntaxError: Invalid URL', color: 'red' }) + bot.tellraw(selector, { text: e, color: 'red' }) } } }