From 211d32366ff82a3c07e5c8e7d107b2fd9d1510fc Mon Sep 17 00:00:00 2001 From: Fortunate-MAN Date: Sun, 26 Mar 2017 15:19:28 +0530 Subject: [PATCH] fixed a bug in the change threshold command --autoupdate --- Sources/CommandSetThreshold.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/CommandSetThreshold.swift b/Sources/CommandSetThreshold.swift index 2cb87c2..c8090a8 100644 --- a/Sources/CommandSetThreshold.swift +++ b/Sources/CommandSetThreshold.swift @@ -11,7 +11,7 @@ import SwiftChatSE class CommandSetThreshold: Command { override public class func usage() -> [String] { - return ["set threshold *", "change threshold *", "change threshold to *", "set threshold to *"] + return ["set threshold to *", "change threshold to *", "set threshold *", "change threshold *"] } override public class func privileges() -> ChatUser.Privileges { @@ -19,11 +19,11 @@ class CommandSetThreshold: Command { } override func run() throws { - guard let newThreshold = (arguments.first.map({Int($0)}) ?? nil) else { + guard let newThreshold = Int (arguments[0]) else { message.reply("Please specify a valid threshold.") return } - + message.room.threshold = newThreshold message.reply("The threshold for this room has been set to \(newThreshold) (*higher* thresholds report more posts).")