How to use the pmxbot.phrases function in pmxbot

To help you get started, we’ve selected a few pmxbot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yougov / pmxbot / pmxbot / commands.py View on Github external
def nailedit(rest):
    "Nail that interview"
    random.shuffle(phrases.interview_excuses)
    yield "Sorry, but " + phrases.interview_excuses[0]
    yield ("/me Nailed it!")
github yougov / pmxbot / pmxbot / util.py View on Github external
def passagg(recipient, sender):
    """
    Generate a passive-aggressive statement to recipient from sender.
    """
    adj = random.choice(pmxbot.phrases.adjs)
    if random.choice([False, True]):
        # address the recipient last
        lead = ""
        trail = recipient if not recipient else ", %s" % recipient
    else:
        # address the recipient first
        lead = recipient if not recipient else "%s, " % recipient
        trail = ""
    body = random.choice(pmxbot.phrases.adj_intros) % adj
    if not lead:
        body = body.capitalize()
    msg = "{lead}{body}{trail}.".format(**locals())
    fw = random.choice(pmxbot.phrases.farewells)
    return "{msg} {fw}, {sender}.".format(**locals())
github yougov / pmxbot / pmxbot / commands.py View on Github external
def job():
    "Generate a job title, http://www.cubefigures.com/job.html"
    j1 = random.choice(phrases.jobs1)
    j2 = random.choice(phrases.jobs2)
    j3 = random.choice(phrases.jobs3)
    return '%s %s %s' % (j1, j2, j3)
github yougov / pmxbot / pmxbot / commands.py View on Github external
def golfclap(rest):
    "Clap for something"
    clapv = random.choice(phrases.clapvl)
    adv = random.choice(phrases.advl)
    adj = random.choice(phrases.adjl)
    if rest:
        clapee = rest.strip()
        karma.Karma.store.change(clapee, 1)
        return "/me claps %s for %s, %s %s." % (clapv, rest, adv, adj)
    return "/me claps %s, %s %s." % (clapv, adv, adj)
github yougov / pmxbot / pmxbot / commands.py View on Github external
def job():
    "Generate a job title, http://www.cubefigures.com/job.html"
    j1 = random.choice(phrases.jobs1)
    j2 = random.choice(phrases.jobs2)
    j3 = random.choice(phrases.jobs3)
    return '%s %s %s' % (j1, j2, j3)
github yougov / pmxbot / pmxbot / util.py View on Github external
def passagg(recipient, sender):
    """
    Generate a passive-aggressive statement to recipient from sender.
    """
    adj = random.choice(pmxbot.phrases.adjs)
    if random.choice([False, True]):
        # address the recipient last
        lead = ""
        trail = recipient if not recipient else ", %s" % recipient
    else:
        # address the recipient first
        lead = recipient if not recipient else "%s, " % recipient
        trail = ""
    body = random.choice(pmxbot.phrases.adj_intros) % adj
    if not lead:
        body = body.capitalize()
    msg = "{lead}{body}{trail}.".format(**locals())
    fw = random.choice(pmxbot.phrases.farewells)
    return "{msg} {fw}, {sender}.".format(**locals())
github yougov / pmxbot / pmxbot / commands.py View on Github external
def featurecreep():
    "Generate feature creep (P+C http://www.dack.com/web/bullshit.html)"
    verb = random.choice(phrases.fcverbs).capitalize()
    adjective = random.choice(phrases.fcadjectives)
    noun = random.choice(phrases.fcnouns)
    return '%s %s %s!' % (verb, adjective, noun)
github yougov / pmxbot / pmxbot / commands.py View on Github external
def featurecreep():
    "Generate feature creep (P+C http://www.dack.com/web/bullshit.html)"
    verb = random.choice(phrases.fcverbs).capitalize()
    adjective = random.choice(phrases.fcadjectives)
    noun = random.choice(phrases.fcnouns)
    return '%s %s %s!' % (verb, adjective, noun)
github yougov / pmxbot / pmxbot / commands.py View on Github external
def job():
    "Generate a job title, http://www.cubefigures.com/job.html"
    j1 = random.choice(phrases.jobs1)
    j2 = random.choice(phrases.jobs2)
    j3 = random.choice(phrases.jobs3)
    return '%s %s %s' % (j1, j2, j3)
github yougov / pmxbot / pmxbot / commands.py View on Github external
def featurecreep():
    "Generate feature creep (P+C http://www.dack.com/web/bullshit.html)"
    verb = random.choice(phrases.fcverbs).capitalize()
    adjective = random.choice(phrases.fcadjectives)
    noun = random.choice(phrases.fcnouns)
    return '%s %s %s!' % (verb, adjective, noun)