reply_message = vk.messages.getById(message_ids=event.message_id)
print('*Кто-то пополнил словарь*')
print('-----------------------')
slv = reply_message['items'][0]['text']
slovas = []
with open('slovar.py', 'r') as f:
old_data = f.read()
new_data = old_data.replace(']',' ')
f.close()
slovas.append(slv)
with open('slovar.py', 'w') as f:
f.write(new_data)
f.close()
slovas.append(slv)
slovas = []
with open('slovar.py', 'a') as f:
f.write('\n"' + slv + '",]')
f.close()
slovas.append(slv)
time.sleep(2)
(slova.pop(random.randint(2, len(slova)-1)))
print('Подождите 30 секунд \nПрошло : ' + (str(time.process_time())))
vk.messages.send(
chat_id=event.chat_id,
message='Ваше фото',
attachment = (spisok),
random_id = get_random_id()
)