try catch may fix it11!

This commit is contained in:
ChomeNS 2022-08-14 19:51:48 +07:00
parent 30e4c370d9
commit f0cb30d790

View file

@ -648,6 +648,7 @@ dcclient.on('messageCreate', async (message) => {
// } catch (e) {
// console.log(e);
// }
try {
const attachment = message.attachments.at(0);
if (attachment!=undefined) {
if (message.content.toLowerCase()==='') {
@ -658,6 +659,9 @@ dcclient.on('messageCreate', async (message) => {
} else {
bot.core.run(`minecraft:tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"ChomeNS ","color":"yellow","clickEvent":{"action":"open_url","value":"https://discord.gg/xdgCkUyaA4"},"hoverEvent":{"action":"show_text","contents":[{"text":"https://discord.gg/xdgCkUyaA4 ","color":"blue"},{"text":"<-- join now","color":"red"}]}},{"text":"Discord","color":"blue","clickEvent":{"action":"open_url","value":"https://discord.gg/xdgCkUyaA4"},"hoverEvent":{"action":"show_text","contents":[{"text":"https://discord.gg/xdgCkUyaA4 ","color":"blue"},{"text":"<-- join now","color":"red"}]}},{"text":"] ","color":"dark_gray"},{"text":"${message.member.displayName}","color":"red","clickEvent":{"action":"copy_to_clipboard","value":"${message.author.username}#${message.author.discriminator}"},"hoverEvent":{"action":"show_text","value":{"text":"${message.author.username}§7#${message.author.discriminator}"} }},{"text":" ","color":"dark_gray"},` + MessageBuilder.fromString('&7' + message.content) + ']');
}
} catch (e) {
return;
}
});
dcclient.login(config.discord.token);