Update commands/translate.js

This commit is contained in:
4Parker02991 2024-01-27 10:08:54 -05:00
parent 64864640f1
commit e97845ca0c

View file

@ -16,13 +16,13 @@ const bot = context.bot
const ChatMessage = require('prismarine-chat')(bot.options.version) const ChatMessage = require('prismarine-chat')(bot.options.version)
try { try {
const res = await translate(args.slice(2).join(' '), { from: args.slice(1).join(' '), to: args[1] }) const res = await translate(args.slice(2).join(' '), { from: args.slice(1).join(' '), to: args[1] })
if(!bot.options.Core.CorelessMode){ if(bot.options.Core.CorelessMode){
bot.chat(ChatMessage.fromNotch([{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }]).toMotd().replaceAll('§', '&')) bot.chat(ChatMessage.fromNotch([{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }]).toMotd().replaceAll('§', '&'))
}else{ }else{
bot.tellraw([{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }]) bot.tellraw([{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }])
} }
} catch (e) { } catch (e) {
if (!bot.options.Core.CorelessMode){ if (bot.options.Core.CorelessMode){
bot.chat(ChatMessage.fromNotch({ text: e.toString(), color: 'red' }).toMotd().replaceAll('§', '&')) bot.chat(ChatMessage.fromNotch({ text: e.toString(), color: 'red' }).toMotd().replaceAll('§', '&'))
}else{ }else{
source.sendFeedback({ text: e, color: 'red' }) source.sendFeedback({ text: e, color: 'red' })