Exemplo n.º 1
0
def _set_token(message):
    text_split = message.text.split()
    if len(text_split) != 2:
        return

    token = text_split[1]
    chat = Chat.set_token(message.chat.id, token)

    send_message(chat, 'New token {}'.format(chat.token))
Exemplo n.º 2
0
def test_set_token(random_token):
    Chat.set_token(123, random_token)
    chat = Chat.get_chat(123)

    assert chat.token == random_token