Beispiel #1
0
def textHandling():
    """Handling a text message."""
    db = rwfb.openDB()
    if request.method == "GET":
        return "HI"
    elif request.method == "POST":
        num = request.values.get("From", None)
        msg = request.values.get("Body", None).lower()
        if rwfb.query(db, num):
            return handleAction(db, num, msg)
        else:
            rwfb.createPlayer(db, num, "worm")
            resp = twilio.twiml.Response()
            resp.message("You've created an account with {} "
                         "under the name {}. Type '?' for a list of"
                         "commands".format(num, "worm"))
            return str(resp)
Beispiel #2
0
def main():
    db = rwfb.openDB()
    #print(rwfb.getAll(db))
    num = "845"#18007778888"
    print(rwfb.getTopTen(db))
    rwfb.createPlayer(db, num, "LeslieLanderTheReprimander")
    rwfb.createPlayer(db, "111", "HartogTheWarthog")
    rwfb.createPlayer(db, "12", "LeiYuAndTheGreatKazoo")
Beispiel #3
0
def createPlayer(number):
    db = rwfb.openDB()
    num = number  # "18007778888"
    rwfb.createPlayer(db, num, "worm")
    return "Player Created"