if match: thisPeer.sendMessage(match.group(1), match.group(2)) continue match = re.match(r"kmessage ([a-zA-Z0-9]+) ([a-zA-Z0-9\ ]+)$", do) if match: thisPeer.kSendMessage(match.group(1), match.group(2)) continue match = re.match(r"friend ([a-zA-Z0-9]+) (.+)$", do) if match: thisPeer.addFriend(match.group(1), match.group(2)) continue match = re.match(r"secret (.+)$", do) if match: thisPeer.setSecret(match.group(1)) continue match = re.match(r"publish (.+)$", do) if match: thisPeer.publishKey(match.group(1)) continue match = re.match(r"fetch-friend ([a-zA-Z0-9]+) (.+)$", do) if match: thisPeer.fetchFriend(match.group(1), match.group(2)) continue # DEFAULT print('Command not recognized')