Fix : RegEx based split in tipbot.ts

This commit is contained in:
eniamza 2021-03-20 18:02:36 +06:00 committed by GitHub
parent 28cb36b5d5
commit a2596f0e93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ exports.tip = {
let tipper = msg.author.id, let tipper = msg.author.id,
words = msg.content words = msg.content
.trim() .trim()
.split(' ') .split(/ +/)
.filter(function(n) { .filter(function(n) {
return n !== ''; return n !== '';
}), }),
@ -68,7 +68,7 @@ exports.multitip = {
let tipper = msg.author.id.replace('!', ''), let tipper = msg.author.id.replace('!', ''),
words = msg.content words = msg.content
.trim() .trim()
.split(' ') .split(/ +/)
.filter(function(n) { .filter(function(n) {
return n !== ''; return n !== '';
}), }),
@ -93,7 +93,7 @@ exports.roletip = {
let tipper = msg.author.id.replace('!', ''), let tipper = msg.author.id.replace('!', ''),
words = msg.content words = msg.content
.trim() .trim()
.split(' ') .split(/ +/)
.filter(function(n) { .filter(function(n) {
return n !== ''; return n !== '';
}), }),