Answer the question
In order to leave comments, you need to log in
Why is the message only sent once?
Message sending code:
def send_message(self, user_id, message):
return self.vk_api.messages.send(
user_id=user_id,
random_id=int(VkLongpollMode.GET_RANDOM_ID),
message=message
)
def waiting_message_listen(self, value_map):
for event in self.long_poll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if value_map.get(event.object.text) is not None:
entry_message = value_map.get(event.object.text)
return float(entry_message)
else:
print('incorrect')
self.send_message(event.object.from_id, 'Вы ввели неверное значение. Повторите попытку.')
Answer the question
In order to leave comments, you need to log in
Message may not be sent due to the same random_id (or missing)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question