コード例 #1
0
 def test_text_contains_emoji(self):
     assert not text_contains_emoji("")
     assert not text_contains_emoji("test")
     assert not text_contains_emoji("lorem ipsum")
     assert text_contains_emoji("🏀")
     assert text_contains_emoji("🏀asd")
     assert text_contains_emoji("asd🏀")
     assert text_contains_emoji("🇫🇷")
コード例 #2
0
ファイル: utils.py プロジェクト: KevinJMao/corji
 def test_text_contains_emoji(self):
     assert not text_contains_emoji("")
     assert not text_contains_emoji("test")
     assert not text_contains_emoji("lorem ipsum")
     assert text_contains_emoji("🏀")
     assert text_contains_emoji("🏀asd")
     assert text_contains_emoji("asd🏀")
     assert text_contains_emoji("🇫🇷")
コード例 #3
0
def corgi():
    """Respond to incoming calls with a simple text message."""
    text = request.values.get("Body") or ""

    if text_contains_emoji(text):
        return get_corgi(text)

    emoji = emojis_for_emoticons.get(text, None)
    if emoji:
        print(emoji)
        return get_corgi(emoji)

    message = render_template('txt/request_does_not_contain_emoji.txt')
    resp = twilio.twiml.Response()
    resp.message(message)
    return str(resp)
コード例 #4
0
ファイル: app.py プロジェクト: KevinJMao/corji
def corgi():
    """Respond to incoming calls with a simple text message."""
    text = request.values.get("Body") or ""

    if text_contains_emoji(text):
        return get_corgi(text)

    emoji = emojis_for_emoticons.get(text, None)
    if emoji:
        print(emoji)
        return get_corgi(emoji)

    message = render_template('txt/request_does_not_contain_emoji.txt')
    resp = twilio.twiml.Response()
    resp.message(message)
    return str(resp)