This commit is contained in:
ChomeNS 2022-10-19 08:37:33 +07:00
parent be57d2caf2
commit 0786d6c801

View file

@ -105,6 +105,9 @@ function botThings() {
hideErrors: true,
};
bot._client = mc.createClient(bot.options);
bot.uuid = bot._client.uuid;
bot.username = bot._client.username;
bot.version = bot._client.version;
bot.queue = [];
bot.write = (name, data) => bot._client.write(name, data);
bot.end = (reason = 'end') => {
@ -220,15 +223,12 @@ function main() {
// fs.appendFileSync('./logs.txt', `\r\Connecting to: ${bot.options.host}:${bot.options.port}...\r\n`);
channel.send(`Connecting to: \`${bot.options.host}:${bot.options.port}\`...`);
bot._client.on('login', async function(data) {
bot.entityId = data.entityId;
const chatMessage = require('prismarine-chat')(bot.version);
const mcData = require('minecraft-data')(bot.version);
console.log(`Successfully logged in to: ${bot.options.host}:${bot.options.port}`);
// fs.appendFileSync('./logs.txt', `\r\nSuccessfully logged in to: ${bot.options.host}:${bot.options.port}\r\n`);
channel.send(`Successfully logged in to: \`${bot.options.host}:${bot.options.port}\``);
bot.uuid = bot._client.uuid;
bot.username = bot._client.username;
bot.entityId = data.entityId;
bot.version = bot._client.version;
previusMessage = undefined;
loginfinish = false;
started = false;