From aeecccdd13d3343d86317aefef0d2f945ab7c76b Mon Sep 17 00:00:00 2001 From: Giuseppe Guerra Date: Mon, 7 Aug 2017 22:14:44 +0200 Subject: [PATCH] Add !mp password and !mp randompassword --- constants/fokabotCommands.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/constants/fokabotCommands.py b/constants/fokabotCommands.py index 2c731ad..eafff08 100644 --- a/constants/fokabotCommands.py +++ b/constants/fokabotCommands.py @@ -956,6 +956,18 @@ def multiplayer(fro, chan, message): _match.toggleSlotLocked(slotID) return "{} has been kicked from the match.".format(username) + def mpPassword(): + password = "" if len(message) < 2 else message[1] + _match = glob.matches.matches[getMatchIDFromChannel(chan)] + _match.changePassword(password) + return "Match password has been changed!" + + def mpRandomPassword(): + password = generalUtils.stringMd5(generalUtils.randomString(32)) + _match = glob.matches.matches[getMatchIDFromChannel(chan)] + _match.changePassword(password) + return "Match password has been changed to a random one" + try: subcommands = { "make": mpMake, @@ -973,6 +985,8 @@ def multiplayer(fro, chan, message): "set": mpSet, "abort": mpAbort, "kick": mpKick, + "password": mpPassword, + "randompassword": mpRandomPassword, } requestedSubcommand = message[0].lower().strip() if requestedSubcommand not in subcommands: