mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 07:38:00 -05:00
move stuff, will prob fix login ploblem but idk
its prob because theres `await loadPlugins()` thing and the `await` is where it breaks everything i guess
This commit is contained in:
parent
7358013cfc
commit
692f83b77d
1 changed files with 12 additions and 4 deletions
16
bot.js
16
bot.js
|
@ -57,21 +57,27 @@ async function createBot (server, config, getBots, setNewBot, dcclient, rl) {
|
|||
|
||||
setNewBot(bot.options.host, bot)
|
||||
|
||||
await loadPlugins(bot, dcclient, config, rl)
|
||||
|
||||
const channel = dcclient.channels.cache.get(config.discord.servers[bot.options.host])
|
||||
|
||||
bot.console.info(
|
||||
`Connecting to: ${bot.options.host}:${bot.options.port}`
|
||||
)
|
||||
channel.send(
|
||||
`Connecting to: \`${bot.options.host}:${bot.options.port}\``
|
||||
)
|
||||
bot._client.on('login', async function (data) {
|
||||
bot.entityId = data.entityId
|
||||
bot.uuid = bot._client.uuid
|
||||
bot.username = bot._client.username
|
||||
|
||||
const chatMessage = require('prismarine-chat')(bot.version)
|
||||
const mcData = require('minecraft-data')(bot.version)
|
||||
|
||||
bot.console.info(
|
||||
`Successfully logged in to: ${bot.options.host}:${bot.options.port}`
|
||||
`Successfully logged in to: ${bot.options.host}:${bot.options.port}`
|
||||
)
|
||||
channel.send(
|
||||
`Successfully logged in to: \`${bot.options.host}:${bot.options.port}\``
|
||||
`Successfully logged in to: \`${bot.options.host}:${bot.options.port}\``
|
||||
)
|
||||
|
||||
bot.vmoptions = {
|
||||
|
@ -124,6 +130,8 @@ async function createBot (server, config, getBots, setNewBot, dcclient, rl) {
|
|||
// ]);
|
||||
})
|
||||
|
||||
await loadPlugins(bot, dcclient, config, rl)
|
||||
|
||||
bot._client.on('end', function (reason) {
|
||||
bot.end(reason, 'end')
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue