From cd1c04e50fb5c5a9273d74306e5cf48e293f382c Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Tue, 10 Jan 2023 17:09:31 +0700 Subject: [PATCH] use arrow function because its cool!!11 --- bot.js | 8 ++++---- plugins/proxy.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bot.js b/bot.js index 266bcc3..1981921 100644 --- a/bot.js +++ b/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 }; diff --git a/plugins/proxy.js b/plugins/proxy.js index d915262..a406f20 100644 --- a/plugins/proxy.js +++ b/plugins/proxy.js @@ -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()