Merge pull request #1673 from matrix-org/t3chguy/fix_op_slashcommand_for_negatives

Allow argument to op slashcommand to be negative as PLs can be -ve
pull/21833/head
David Baker 2018-01-05 11:28:52 +00:00 committed by GitHub
commit 242d84c63a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -295,7 +295,7 @@ const commands = {
// Define the power level of a user
op: new Command("op", "<userId> [<power level>]", function(roomId, args) {
if (args) {
const matches = args.match(/^(\S+?)( +(\d+))?$/);
const matches = args.match(/^(\S+?)( +(-?\d+))?$/);
let powerLevel = 50; // default power level for op
if (matches) {
const userId = matches[1];