Отправка сообщения внутри цикла, поэтому и отправляется каждое вложение в каждом сообщении отдельно. Как я понял, необходимо отправить все вложения из события, тогда делаем так:
attachments = ""
for i in event.raw['object']['attachments']:
attachments1 = i['type']
try:
attach = attachments1 + str(i[attachments1]['owner_id']) + '_' + str(i[attachments1]['id']) + '_' + str(i[attachments1]['access_key']) + ','
attachments += attach
except:
attach = attachments1 + str(i[attachments1]['owner_id']) + '_' + str(i[attachments1]['id']) + ','
attachments += attach
vk.method('messages.send', {'peer_id': event.object.peer_id, 'message': event.object.text[5:], 'attachment': attachments, 'random_id': 0})
Или же так:
attachments = []
eventAttachments = event.raw['object']['attachments']
for attachment in eventAttachments:
attach = "%s%s_%s" % (attachment['type'], attachment['owner_id'], attachment['id'])
if 'access_key' in attachment:
attach += "_%s" % attachment['access_key']
attachments.append(attach)
vk.method('messages.send', {'peer_id': event.object.peer_id, 'message': event.object.text[5:], 'attachment': ','.join(attachments), 'random_id': 0})