def handleChatCommand(msg): # Try to split message args = msg.split(' ',1) # Check if the format is correct and is not empty if len(args) != 2 or not args[0] or not args[1]: return # Split correctly the message t = args[0].lower() if t == 'private' or t == 'note': # then check message is not empty argsExtra = args[1].split(' ',1) if len(argsExtra) != 2 or not argsExtra[0] or not argsExtra[1]: return args.pop(1) args += argsExtra # Check message type sent = False if t == "all": sent = phBotChat.All(args[1]) elif t == "private": sent = phBotChat.Private(args[1],args[2]) elif t == "party": sent = phBotChat.Party(args[1]) elif t == "guild": sent = phBotChat.Guild(args[1]) elif t == "union": sent = phBotChat.Union(args[1]) elif t == "note": sent = phBotChat.Note(args[1],args[2]) elif t == "stall": sent = phBotChat.Stall(args[1]) elif t == "global": sent = phBotChat.Global(args[1]) if sent: log('Plugin: Message "'+t+'" sent successfully!')
def chat(args): args = FixEscapeComma(args) # Avoid wrong structure and empty stuffs if len(args) < 3 or not args[1] or not args[2]: return # Check message type sent = False t = args[1].lower() if t == "all": sent = phBotChat.All(args[2]) elif t == "private": sent = phBotChat.Private(args[2],args[3]) elif t == "party": sent = phBotChat.Party(args[2]) elif t == "guild": sent = phBotChat.Guild(args[2]) elif t == "union": sent = phBotChat.Union(args[2]) elif t == "note": sent = phBotChat.Note(args[2],args[3]) elif t == "stall": sent = phBotChat.Stall(args[2]) elif t == "global": sent = phBotChat.Global(args[2]) if sent: log('Plugin: Message "'+t+'" sent successfully!')
def chat(args): # check arguments length and empty message if (len(args) >= 3 and len(args[2]) > 0): success = False type = args[1].lower() if type == "all": success = phBotChat.All(args[2]) elif type == "private": success = phBotChat.Private(args[2], args[3]) elif type == "party": success = phBotChat.Party(args[2]) elif type == "guild": success = phBotChat.Guild(args[2]) elif type == "union": success = phBotChat.Union(args[2]) elif type == "note": success = phBotChat.Note(args[2], args[3]) elif type == "stall": success = phBotChat.Stall(args[2]) if success: log("Plugin: Message sent successfully (" + pName + ")")