Allow argument to op slashcommand to be negative as PLs can be -ve

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2017-12-21 12:23:48 +00:00
parent fa14bc9b8d
commit ab347c82f7
No known key found for this signature in database
GPG key ID: 0435A1D4BBD34D64

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];