 				handleError(error, "while running \"\(command.message.content)\"")
 			}
 			self.runningCommands.remove(at: self.runningCommands.index {$0 === command}!)
-			if (self.pendingStopAction != .run) && self.runningCommands.isEmpty {
-				self.shutdownHandler(self.pendingStopAction == .reboot, self.pendingStopAction == .update)
+			if (self.pendingStopReason != nil) && self.runningCommands.isEmpty {
+				self.shutdownHandler(self.pendingStopReason!)
 			}
 		}
 	}

		
		var lowest: (command: String, score: Int)?
		for (command, score) in commandScores {
			if score <= command.characters.count/2 && score < (lowest?.score ?? Int.max) {
				lowest = (command, score)
			}
		}
		
		if let (command, _) = lowest {
			room.postReply("Unrecognized command `\(components.joined(separator: " "))`; did you mean `\(command)`?", to: message)
		}
	}
	
	open func processMessage(_ room: ChatRoom, message: ChatMessage, isEdit: Bool) {
		let lowercase = message.content.lowercased()
		

			let message = "You need the \(formatArray(missing.names, conjunction: "and")) " +
			"\(pluralize(missing.names.count, "privilege")) to run that command."
			
			command.message.room.postReply(message, to: command.message)
			return
		}
		
		
		runningCommands.append(command)
