# Main
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
if event.to_me:
request = event.text
if request.lower() == "привет":
write_msg(event.user_id, "Здравствуй!")
elif request.lower() == "пока":
write_msg(event.user_id, "Пока((")
elif request.lower() == "спасибо":
write_msg(event.user_id, "Всегда пожалуйста!")
elif request in set(commands_later):
write_msg(event.user_id, 'Скоро все будет)')
elif request in set(commands):
while True:
write_msg(event.peer_id, 'Введите число для перевода в другую CC')
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
if not event.from_me:
num = event.text
try:
num = int(num)
except:
pass
write_msg(event.peer_id, 'Введите изначальную CC')
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
if not event.from_me:
from_ss = event.text
try:
from_ss = int(from_ss)
except:
pass
write_msg(event.peer_id, 'Введите CC, в которую нужно перевести число')
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
if not event.from_me:
to_ss = event.text
try:
to_ss = int(to_ss)
except:
pass
result = convert_base(num, to_ss, from_ss)
write_msg(event.peer_id, result)