Beispiel #1
0
def strax(text):
    """Strax quote."""

    if text:
        target = text.strip()
        variables = {"user": target}

        generator = textgen.TextGenerator(strax["target_template"],
                                          strax["parts"],
                                          variables=variables)
    else:
        generator = textgen.TextGenerator(strax["template"], strax["parts"])

    # Become Strax
    return generator.generate_string()
Beispiel #2
0
def bdsm(text, send_message):
    """Just a little bit of kinky fun."""
    user = text.strip()
    generator = textgen.TextGenerator(bdsm_data["templates"],
                                      bdsm_data["parts"],
                                      variables={"user": user})
    send_message(generator.generate_string())
Beispiel #3
0
def gift(text):
    """<user> - gives gift to <user>"""
    target = text.strip()
    variables = {"user": target}

    generator = textgen.TextGenerator(presents["templates"],
                                      presents["parts"],
                                      variables=variables)
    return generator.generate_string()
Beispiel #4
0
def spank(text, send_message):
    """<user> - Spanks a  <user>"""
    user = text.strip()

    generator = textgen.TextGenerator(spank_data["templates"],
                                      spank_data["parts"],
                                      variables={"user": user})
    # act out the message
    send_message(generator.generate_string())
Beispiel #5
0
def kill(text):
    """<user> - kills <user>"""
    target = text.strip()

    generator = textgen.TextGenerator(kills["templates"],
                                      kills["parts"],
                                      variables={"user": target})

    # act out the message
    return generator.generate_string()
Beispiel #6
0
def slap(text):
    """<user> -- Makes the bot slap <user>."""
    target = text.strip()

    variables = {"user": target}
    generator = textgen.TextGenerator(slaps["templates"],
                                      slaps["parts"],
                                      variables=variables)

    # act out the message
    return generator.generate_string()
Beispiel #7
0
def compliment(text):
    """<user> -- Makes the bot compliment <user>."""
    target = text.strip()

    variables = {"user": target}
    generator = textgen.TextGenerator(compliments["templates"],
                                      compliments["parts"],
                                      variables=variables)

    # act out the message
    return generator.generate_string()
Beispiel #8
0
def get_generator(_json):
    data = json.loads(_json)
    return textgen.TextGenerator(data["templates"],
                                 data["parts"],
                                 default_templates=data["default_templates"])