Perhaps better way of splitting message

This commit is contained in:
Histmy 2020-12-07 12:47:48 +01:00
parent 647d75f14f
commit e40671a524

7
app.js
View File

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