Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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.")
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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 :(")
Exemplo n.º 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}")
Exemplo n.º 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()