You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
handle slashcommands with no args
This commit is contained in:
@@ -335,8 +335,14 @@ module.exports = {
|
|||||||
input = input.replace(/\s+$/, "");
|
input = input.replace(/\s+$/, "");
|
||||||
if (input[0] === "/" && input[1] !== "/") {
|
if (input[0] === "/" && input[1] !== "/") {
|
||||||
var bits = input.match(/^(\S+?)( +(.*))?$/);
|
var bits = input.match(/^(\S+?)( +(.*))?$/);
|
||||||
var cmd = bits[1].substring(1).toLowerCase();
|
var cmd, args;
|
||||||
var args = bits[3];
|
if (bits) {
|
||||||
|
cmd = bits[1].substring(1).toLowerCase();
|
||||||
|
args = bits[3];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cmd = input;
|
||||||
|
}
|
||||||
if (cmd === "me") return null;
|
if (cmd === "me") return null;
|
||||||
if (aliases[cmd]) {
|
if (aliases[cmd]) {
|
||||||
cmd = aliases[cmd];
|
cmd = aliases[cmd];
|
||||||
|
|||||||
Reference in New Issue
Block a user