fixed bugs + improved safety

This commit is contained in:
mmacierzanka committed 2021-06-21 20:07:24 +02:00
1 parent 71bbe359fd
commit 3bc68a874e
2 files changed
+10 -4

No files matched your search

+7 -1
View File
@@ -73,9 +73,15 @@ class Command {
const buff = phrase.map((p) => {
return p.split(' ').join('_');
});
buff.map(e => {
if(e == '' || e == ' ') {
const i = buff.indexOf(e);
buff.splice(i, 1);
}
});
return buff;
}
else if(typeof phrase == 'string') {
else if(typeof phrase == 'string' && phrase != '' && phrase != ' ') {
const buff = [];
buff.push(phrase.split(' ').join('_'));
return buff;