Perhaps better way of splitting message
This commit is contained in:
parent
647d75f14f
commit
e40671a524
7
app.js
7
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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user