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
This commit is contained in:
commit
242d84c63a
1 changed files with 1 additions and 1 deletions
|
@ -295,7 +295,7 @@ const commands = {
|
||||||
// Define the power level of a user
|
// Define the power level of a user
|
||||||
op: new Command("op", "<userId> [<power level>]", function(roomId, args) {
|
op: new Command("op", "<userId> [<power level>]", function(roomId, args) {
|
||||||
if (args) {
|
if (args) {
|
||||||
const matches = args.match(/^(\S+?)( +(\d+))?$/);
|
const matches = args.match(/^(\S+?)( +(-?\d+))?$/);
|
||||||
let powerLevel = 50; // default power level for op
|
let powerLevel = 50; // default power level for op
|
||||||
if (matches) {
|
if (matches) {
|
||||||
const userId = matches[1];
|
const userId = matches[1];
|
||||||
|
|
Loading…
Reference in a new issue