def primer():
commands
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.from_me:
try:
if event.text == "пример":
commands ()
upload = VkUpload(vk)
graffiti = upload.graffiti(image='filename.png', peer_id=peer_id)
owner_id = graffiti['graffiti']['owner_id']
graffiti_id = graffiti['graffiti']['id']
attachment = 'doc{}_{}'.format(owner_id, graffiti_id)
vk.messages.send(peer_id=peer_ids, attachment=attachment, random_id=get_random_id())