Add comment for the regex
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
293bd15ee9
commit
3fa13d7de3
|
@ -995,6 +995,7 @@ export const Commands = [
|
||||||
args: "<user-id> <message>",
|
args: "<user-id> <message>",
|
||||||
runFn: function(_, args) {
|
runFn: function(_, args) {
|
||||||
if (args) {
|
if (args) {
|
||||||
|
// matches the first whitespace delimited group and then the rest of the string
|
||||||
const matches = args.match(/^(\S+?)(?: +(.*))?$/s);
|
const matches = args.match(/^(\S+?)(?: +(.*))?$/s);
|
||||||
if (matches) {
|
if (matches) {
|
||||||
const [userId, msg] = matches.slice(1);
|
const [userId, msg] = matches.slice(1);
|
||||||
|
|
Loading…
Reference in New Issue