mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
use arrow function because its cool!!11
This commit is contained in:
parent
d449ec6f20
commit
cd1c04e50f
2 changed files with 7 additions and 7 deletions
8
bot.js
8
bot.js
|
@ -64,7 +64,7 @@ async function createBot (server, config, getBots, setNewBot, dcclient, rl) {
|
|||
|
||||
await loadPlugins(bot, dcclient, config, rl)
|
||||
|
||||
bot._client.on('end', function (reason) {
|
||||
bot._client.on('end', (reason) => {
|
||||
bot.end(reason, 'end')
|
||||
})
|
||||
|
||||
|
@ -98,17 +98,17 @@ async function createBot (server, config, getBots, setNewBot, dcclient, rl) {
|
|||
bot.write('keep_alive', { keepAliveId })
|
||||
})
|
||||
|
||||
bot._client.on('kick_disconnect', function (data) {
|
||||
bot._client.on('kick_disconnect', (data) => {
|
||||
const parsed = JSON.parse(data.reason)
|
||||
bot.end(parsed, 'kick_disconnect')
|
||||
})
|
||||
|
||||
bot._client.on('disconnect', function (data) {
|
||||
bot._client.on('disconnect', (data) => {
|
||||
const parsed = JSON.parse(data.reason)
|
||||
bot.end(parsed, 'disconnect')
|
||||
})
|
||||
|
||||
bot._client.on('error', function () {})
|
||||
bot._client.on('error', () => {})
|
||||
|
||||
return bot
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@ function inject (bot, dcclient, config) {
|
|||
version
|
||||
})
|
||||
|
||||
srv.on('login', function (client) {
|
||||
srv.on('login', (client) => {
|
||||
bot.console.info(`[Proxy] ${client.username} connected to proxy`)
|
||||
let clientEnded = false
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
@ -83,7 +83,7 @@ function inject (bot, dcclient, config) {
|
|||
targetEnded = true
|
||||
})
|
||||
|
||||
client.on('end', function () {
|
||||
client.on('end', () => {
|
||||
clientEnded = true
|
||||
target.end()
|
||||
target.removeAllListeners()
|
||||
|
@ -91,7 +91,7 @@ function inject (bot, dcclient, config) {
|
|||
bot.console.info(`[Proxy] ${client.username} ended`)
|
||||
})
|
||||
|
||||
client.on('error', function () {
|
||||
client.on('error', () => {
|
||||
clientEnded = true
|
||||
target.removeAllListeners()
|
||||
client.removeAllListeners()
|
||||
|
|
Loading…
Reference in a new issue