D
D
dotaoneloveforever2021-05-28 17:46:00
Python
dotaoneloveforever, 2021-05-28 17:46:00

How to force a bot to send a photo already uploaded to VK to a conversation?

def send_photo(url):
vk_session.method('messages.send', {'user_id': id, 'attachment': url, 'random_id': 0})
vk.method("messages.send", {"peer_id" : id, "message": "TEST", "attachment": "photo-57846937_457307562", "random_id": 0})

for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
vk.messages .send(
key = ('0b2726f36c1010184240301d8684459c0dc2a5ce'),
server = (' https://lp.vk.com/wh204823014 '),
ts=('1'),
sender(msg),
random_id = get_random_id(),
chat_id = event.chat_id,
attachment=','.join(attachments),
msg = event.text.lower(),
massege=vk.method("messages.send", {"peer_id": id, "message": "TEST", "attachment": "photo-57846937_457307562", "random_id": 0})
)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question