From 0becaf1feeb5ad6066ab046d8002b3516c699f81 Mon Sep 17 00:00:00 2001 From: Histmy Date: Tue, 9 Feb 2021 01:39:30 +0100 Subject: [PATCH] Client doesn't need to be passed --- app.js | 2 +- modules/normal.js | 4 ++-- modules/status.js | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app.js b/app.js index 4a9b8c6..3430701 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,7 @@ client.on('message', mes => { if (mes_prefix === prefix) { const celArgs = args.join(' '); for (let i = 0; i < modules.length; i++) { - if (modules[i](mes, komand, celArgs, client)) break; + if (modules[i](mes, komand, celArgs)) break; if (i === modules.length - 1) mes.channel.send('co to znamena ti gadzovko'); } } diff --git a/modules/normal.js b/modules/normal.js index 5f0c5e3..73ba144 100644 --- a/modules/normal.js +++ b/modules/normal.js @@ -6,7 +6,7 @@ const akce = {hraj: 'PLAYING', sleduj: 'WATCHING', poslouchej: 'LISTENING', sout const rand = max => Math.floor(Math.random() * max); -module.exports = (mes, komand, celArgs, client) => { +module.exports = (mes, komand, celArgs) => { let corict; switch (komand) { @@ -23,7 +23,7 @@ module.exports = (mes, komand, celArgs, client) => { case 'soutěž': case 'nedelej': case 'nedělej': - client.user.setActivity(celArgs, {type: akce[komand]}); + mes.client.user.setActivity(celArgs, {type: akce[komand]}); mes.channel.send('ano pane'); mes.react('730175107313565717'); break; diff --git a/modules/status.js b/modules/status.js index dff8db4..f52469a 100644 --- a/modules/status.js +++ b/modules/status.js @@ -1,16 +1,17 @@ -module.exports = (_m, komand, _c, client) => { +module.exports = (mes, komand) => { + const c = mes.client.user; switch (komand) { case 'online': case 'onlajn': case 'zelenej': - client.user.setStatus('online'); + c.setStatus('online'); break; case 'neviditelnej': case 'offline': case 'oflajn': - client.user.setStatus('invisible'); + c.setStatus('invisible'); break; case 'dnd': @@ -18,7 +19,7 @@ module.exports = (_m, komand, _c, client) => { case 'nerušit': case 'červenej': case 'cervenej': - client.user.setStatus('dnd'); + c.setStatus('dnd'); break; case 'žlutej': @@ -27,7 +28,7 @@ module.exports = (_m, komand, _c, client) => { case 'idle': case 'nepřítomnej': case 'nepritomnej': - client.user.setStatus('idle'); + c.setStatus('idle'); break; default: