def helpCommand(username, sock, queue, text): if (now.compareToNow() > cfg.HELP_COOLDOWN_SECONDS): libs.chat( sock, "Type !pokemote (emote) or !pokemote (emote) (type1) (type2) to create a Pokemon! Any Twitch emotes or FFZ emotes will work. Type !advanced for more detail." ) now.update()
def commandList(username, sock, queue, text): if (now.compareToNow() > cfg.HELP_COOLDOWN_SECONDS): libs.chat( sock, "pokemote command list: pokemote, pokemotehelp, movelist, abilitylist, source" ) now.update()
def abilityList(username, sock, queue, text): if (now.compareToNow() > cfg.HELP_COOLDOWN_SECONDS): libs.chat( sock, "ability list: https://github.com/jscottpilgrim/Pokemotes/blob/master/abilities.csv" ) now.update()
def advancedHelp(username, sock, queue, text): if (now.compareToNow() > cfg.HELP_COOLDOWN_SECONDS): libs.chat( sock, "Advanced pokemote help: https://github.com/jscottpilgrim/Pokemotes/blob/master/advancedCommandHelp.txt" ) now.update()
def userLimit(username, sock, queue, text): if (username.lower() == streamerName): try: validators['userLimit'].limit = int(text) libs.chat( sock, "Max Pokemon in queue per user has been set to " + str(text)) except ValueError: libs.chat(sock, "That is not a valid integer.")
def toggleRepeats(username, sock, queue, text): if (username.lower() == streamerName): newValue = not validators['repeats'].allow validators['repeats'].allow = newValue if newValue: outputText = "Repeat emotes are now enabled" else: outputText = "Repeat emotes are now disabled" libs.chat(sock, outputText)
def handleChatInput(sock, input, queue): try: username = re.search(r"\w+", input).group(0) message = CHAT_MSG.sub("", input).strip() print(username + ":-" + message + "-") com = command.commandFactory(message) startCommandThread(com, (username, sock, queue)) except: libs.chat(sock, "Stop trying to break me BibleThump") return
def handleChatInput(sock, input, queue): for chatmsg in input.splitlines(): try: username = re.search(r"\w+", chatmsg).group(0) message = CHAT_MSG.sub("", chatmsg).strip() print(username + ":-" + message + "-") com = command.commandFactory(message) startCommandThread(com, (username, sock, queue)) except Exception as e: libs.chat(sock, f"error: {e}") #"Stop trying to break me BibleThump") return
def pokemonCommand(username, sock, queue, text, validators): jsonPokemon = generatePokemon(text, username) error, errorMessage = validatePokemon(jsonPokemon, validators, queue) if (error): libs.chat(sock, errorMessage) return try: formattedInput = pokemonCommandLibs.formatInput(jsonPokemon) queue.put([jsonPokemon, formattedInput.encode("ascii", "ignore")]) libs.chat( sock, text + " has been added to the queue (queue position: " + str(queue.qsize()) + ")") except NoEmoteException: libs.chat(sock, "That does not appear to be a valid Twitch or FFZ emote :(")
def tpStop(username, sock, queue, text): if (username.lower() == streamerName): global acceptTwitchPlaysActions acceptTwitchPlaysActions = False libs.chat( sock, f"updated twitch plays status to {acceptTwitchPlaysActions}")
def sourceCode(username, sock, queue, text): if (now.compareToNow() > cfg.HELP_COOLDOWN_SECONDS): libs.chat(sock, "source: https://github.com/jscottpilgrim/Pokemotes") now.update()