Пример #1
0
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()
Пример #2
0
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()
Пример #3
0
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()
Пример #4
0
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()
Пример #5
0
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.")
Пример #6
0
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)
Пример #7
0
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
Пример #8
0
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
Пример #9
0
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 :(")
Пример #10
0
def tpStop(username, sock, queue, text):
    if (username.lower() == streamerName):
        global acceptTwitchPlaysActions
        acceptTwitchPlaysActions = False
        libs.chat(
            sock, f"updated twitch plays status to {acceptTwitchPlaysActions}")
Пример #11
0
def sourceCode(username, sock, queue, text):
    if (now.compareToNow() > cfg.HELP_COOLDOWN_SECONDS):
        libs.chat(sock, "source: https://github.com/jscottpilgrim/Pokemotes")
        now.update()