This commit is contained in:
7cc5c4f330d47060 2024-08-18 03:18:09 -04:00
parent c3ef6752f3
commit 6f0d9e8994
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
6 changed files with 34 additions and 33 deletions

View file

@ -1,7 +1,7 @@
const { getMessage } = require('../util/lang.js')
module.exports = {
execute: (c) => {
const reply=function(name, item){
const reply = function (name, item) {
return {
translate: '%s: %s',
color: c.colors.primary,
@ -17,18 +17,18 @@ module.exports = {
]
}
}
c.reply(reply("uuid",c.uuid))
c.reply(reply("username",c.username))
c.reply(reply("nickname",c.nickname))
c.reply(reply("command",c.command))
c.reply(reply("msgType",c.msgType))
c.reply(reply("prefix",c.prefix))
c.reply(reply("args",c.args.join(", ")))
c.reply(reply("verify",c.verify.toString()))
c.reply(reply("host",c.host))
c.reply(reply("port",c.port.toString()))
c.reply(reply("lang",c.lang))
c.reply(reply("colorPrimary",c.colors.primary))
c.reply(reply("colorSecondary",c.colors.secondary))
c.reply(reply('uuid', c.uuid))
c.reply(reply('username', c.username))
c.reply(reply('nickname', c.nickname))
c.reply(reply('command', c.command))
c.reply(reply('msgType', c.msgType))
c.reply(reply('prefix', c.prefix))
c.reply(reply('args', c.args.join(', ')))
c.reply(reply('verify', c.verify.toString()))
c.reply(reply('host', c.host))
c.reply(reply('port', c.port.toString()))
c.reply(reply('lang', c.lang))
c.reply(reply('colorPrimary', c.colors.primary))
c.reply(reply('colorSecondary', c.colors.secondary))
}
}

View file

@ -20,8 +20,8 @@ module.exports = {
const parsed = parsePlain(json)
const split = parsed.split(': ')
const chatName = split.splice(0, 1)[0]
const chatNameSplit = chatName.split(" ");
const nickname = chatNameSplit[chatNameSplit.length-1]
const chatNameSplit = chatName.split(' ')
const nickname = chatNameSplit[chatNameSplit.length - 1]
const username = b.findRealName(chatName)
const uuid = b.findUUID(username)
b.emit('chat', {
@ -76,7 +76,8 @@ module.exports = {
if (data.type === 4) {
b.emit('chat', {
json: parse1204(data.unsignedChatContent),
type: 'player', uuid: data.senderUuid,
type: 'player',
uuid: data.senderUuid,
message: data.plainMessage,
nickname: parsePlain(parse1204(data.networkName)),
username: b.findRealNameFromUUID(data.senderUuid)
@ -122,8 +123,8 @@ module.exports = {
const parsed = parsePlain(json)
const split = parsed.split(': ')
const chatName = split.splice(0, 1)[0]
const chatNameSplit = chatName.split(" ");
const nickname = chatNameSplit[chatNameSplit.length-1]
const chatNameSplit = chatName.split(' ')
const nickname = chatNameSplit[chatNameSplit.length - 1]
const username = b.findRealName(chatName)
const uuid = b.findUUID(username)
b.emit('chat', {
@ -153,17 +154,17 @@ module.exports = {
} else { // Servers with Extras chat, such as Kaboom
const split = parsed.split(': ')
chatName = split.splice(0, 1)[0]
const chatNameSplit = chatName.split(" ");
nickname = chatNameSplit[chatNameSplit.length-1]
const chatNameSplit = chatName.split(' ')
nickname = chatNameSplit[chatNameSplit.length - 1]
username = b.findRealName(chatName)
uuid = b.findUUID(username)
message = split.join(': ')
}
if(data.uuid) uuid = data.uuid;
if (data.uuid) uuid = data.uuid
b.emit('chat', {
json,
type: 'legacy',
uuid: uuid,
uuid,
message,
nickname,
username

View file

@ -55,8 +55,8 @@ module.exports = {
}
b._client.on('login', () => {
b._client.write("settings",{
locale: "ru_RU",
b._client.write('settings', {
locale: 'ru_RU',
viewDistance: 4,
chatFlags: 0, // Enable full chat functionality
chatColors: true,

View file

@ -49,18 +49,18 @@ module.exports = {
return '[[[[ no name ]]]]'
}
b.findRealNameFromUUID = (name) => {
if(b.players[name]){
if (b.players[name]) {
return b.players[name].realName
} else {
return "[[[[ no name ]]]]"
return '[[[[ no name ]]]]'
}
}
b.findDisplayName = (name) => {
if(b.players[name]){
const displayName = b.players[name].displayName.split(" ");
return displayName[displayName.length-1]
if (b.players[name]) {
const displayName = b.players[name].displayName.split(' ')
return displayName[displayName.length - 1]
} else {
return "[[[[ No display name ]]]]"
return '[[[[ No display name ]]]]'
}
}
}

View file

@ -7,7 +7,7 @@ class Command {
this.username = user
this.nickname = nick
this.command = cmd
this.msgType = msgType;
this.msgType = msgType
this.prefix = prefix
this.bot = bot
this.type = 'minecraft'

View file

@ -9,7 +9,7 @@ class ConsoleCommand {
this.username = 'Owner'
this.nickname = 'Console'
this.command = cmd
this.msgType = "_bot_console";
this.msgType = '_bot_console'
this.prefix = ''
this.bot = index2 >= 0
? index.bot[index2]