G
G
GetLuck022017-10-31 10:34:44
Python
GetLuck02, 2017-10-31 10:34:44

Sending video with vkapi and python3, help?

I'm trying to set up sending a video using my bot, but I can't find it on the Internet, what do I need to do, what tools should I use? please help, if possible, send a link to the documentation on working with video (PYTHON3) approximately

# -*- coding: utf-8 -*-
import time
import vk_api

import string
vk = vk_api.VkApi(login = ', password = '')
#vk_api.VkApi(token = 'a02d...e83fd') #Авторизоваться как сообщество
vk.auth()
values = {'out': 0,'count': 100,'time_offset': 60}
#vkapi = VK.api('my_app_id', 'user_login', 'user_password')
def write_msg(user_id, s):
    vk.method('messages.send', {'chat_id':user_id,'message':s})

while True:

    response = vk.method('messages.get', values)
    if response['items']:
        values['last_message_id'] = response['items'][0]['id']
    for item in response['items']:
            if response['items'][0]['body'] == 'Бот видео' :
                write_msg(item[u'chat_id'],#что написать чтобы отправить видео#)
    time.sleep(2)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sudo rm -rf /, 2019-01-17
@MaxLevs

You don't need a message, but an attachment parameter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question