fix discord ploblem

This commit is contained in:
ChomeNS 2022-11-18 17:52:17 +07:00
parent 8403eec8cd
commit a23abfb5af

View file

@ -131,7 +131,15 @@ async function list(bot, discord, channeldc, prefix, selector, args) {
bot.tellraw(selector, message);
} catch (e) {
bot.tellraw(selector, {text: e.toString(), color: 'red'});
if (discord) {
const Embed = new MessageEmbed()
.setColor('#FF0000')
.setTitle('Error')
.setDescription(`\`\`\`${e.toString()}\`\`\``);
channeldc.send({embeds: [Embed]});
} else {
bot.tellraw(selector, {text: e.toString(), color: 'red'});
}
}
};
@ -304,7 +312,7 @@ module.exports = {
}
break;
case 'list':
list(bot, true, channeldc, prefix);
list(bot, true, channeldc, prefix, '@a', args);
break;
case 'nowplaying':
Embed = new MessageEmbed()