[Python] vk-bot - get the file from attachments

Discussão em 'Python' iniciado por Stack, Abril 3, 2025.

  1. Stack

    Stack Membro Participativo

    I need help with a VK bot. It should take text from a file sent by the user, then receive an image, and finally send a post with the text and image to the group it is connected to. I can't get the file from attachments.

    elif current_state[user_id] == 'text' and hasattr(event, 'attachments'):
    for attach in event.attachments:
    if attach[-5:] == '_type':
    continue
    tp = event.attachments[attach + '_type']
    doc = vk.docs.getById(docs=event.attachments

Compartilhe esta Página