L
L
Loyxim2020-08-06 12:49:02
Python
Loyxim, 2020-08-06 12:49:02

How to send 2 attachments in one message using a bot?

I wrote a small video search function in VK, I'm trying to send 2 attachments in one message using the 'messages.send' method, only one video is attached, what should I do?
Ps I read the documentation, it doesn't say there, or I'm blind

if textt[0] == '.video':
            fov = event.text
            poisk = fov.replace('.video ', '')
            video = vk.video.search(q=poisk, count=10)
            titl1 = video['items'][0]['title']
            titl2 = video['items'][1]['title']
            vid_id1 = video['items'][0]['ads']['params']['video_id']
            vid_id2 = video['items'][1]['ads']['params']['video_id']
            vid1 = str("video" + str(vid_id1))
            vid2 = str("video" + str(vid_id2))
            videos = vid1,vid2
            id3 = event.peer_id
            send_attachment(id3, ' Результаты поиска:\n1. Название: ' + titl1 + '\n2. Название: ' + titl2, videos)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
soremix, 2020-08-06
@SoreMix

https://vk.com/dev/messages.send
1. <type><owner_id>_<media_id>
2.

media attachments to the private message, separated by commas.
you have a tuple

S
Sanes, 2015-03-04
@Sanes

The easiest way is to use telephony services, such as Zadarma. Set up scenarios as you need, numbers, call forwarding, voice menu, etc.

I
Ivan, 2015-03-04
@LiguidCool

A number is bought from a VOIP operator, Asterisk is installed and configured.
But I somehow made it easier - you put the client's voip on mobile phones and the user calls directly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question