diff --git a/app.js b/app.js index 527b535..acb240a 100644 --- a/app.js +++ b/app.js @@ -60,10 +60,9 @@ client.on('ready', () => console.log('A jedeš!')); client.on('message', mes => { if (process.env.IGNORE_MESS) return; - if (mes.content.toLowerCase().startsWith(prefix)) { - const [...args] = mes.content.toLowerCase().split(' ').slice(1); - const komand = args[0]; - const celArgs = args.slice(1).join(' '); + const [mes_prefix, komand, ...args] = mes.content.toLowerCase().split(' '); + if (mes_prefix === prefix) { + const celArgs = args.join(' '); let corict; let vojs; switch (komand) {