Пример #1
0
def send(channel_id, token):
    channel_id = int(channel_id)
    data = load()
    channelDict = data['channelDict']
    for channel in channelDict:
        if int(channel_id) == channel['channel_id']:
            message_send(token, channel_id, str(channel['standlist']))

    data = load()
    channelDict = data['channelDict']
    for channel in channelDict:
        if int(channel_id) == channel['channel_id']:
            channel['standUp'] = False
            channel['standtime'] = None
            channel['standlist'] == ''
            data['channelDict'] = channelDict
            save(data)
            return
Пример #2
0
def test1():
    restart()
    authRegisterDict1 = auth_register("*****@*****.**", "123456",
                                      "Tim", "Hu")
    token1 = authRegisterDict1["token"]
    UID1 = authRegisterDict1['u_id']
    authRegisterDict2 = auth_register("*****@*****.**", "1we33456",
                                      "Hayden", "Smith")
    token2 = authRegisterDict2["token"]
    UID2 = authRegisterDict2['u_id']
    authRegisterDict3 = auth_register("*****@*****.**", "1we33ee456",
                                      "Jeff", "Lu")
    token3 = authRegisterDict3["token"]

    UID3 = authRegisterDict3['u_id']

    authRegisterDict4 = auth_register("*****@*****.**", "jijijij37236",
                                      'daniel', 'quin')
    token4 = authRegisterDict4["token"]

    UID4 = authRegisterDict4['u_id']
    channel_id = channels_create(token1, 'test1', True)
    channel_invite(token1, channel_id, UID2)
    channel_invite(token1, channel_id, UID3)
    message_send(token1, channel_id, 'hello')
    message_send(token2, channel_id, 'hi')
    message_send(token3, channel_id, 'numb')
    result = search(token1, 'hello')
    assert result['messages'][0]['message'] == 'hello'
    assert result['messages'][0]['message_id'] == 1
Пример #3
0
def send():
    token = request.form.get('token')
    channel_id = request.form.get('channel_id')
    message = request.form.get('message')
    return dumps(message_send(token, channel_id, message))