If I set the user_id and the message text, then everything works fine print(vk.messages.send(user_id = 'Здесь id',random_id= "" ,message="Здесь текст"))
If I set the user_id and the message text via a variable, it gives an error
vk_session = vk_api.VkApi('Логин', 'пароль') vk_session.auth() vk = vk_session.get_api() def sendmessages(usid,textsend): print(vk.messages.send(user_id = 'usid',random_id= "" ,message="textsend")) commands00 = input() usid = input('Укажите id:') textsend = input('Укажите текст сообщения:') if commands00 == ('send'): sendmessages(usid,textsend)
vk_api.exceptions.ApiError: [100] not integer
It says that user_id не целое число
, I do not understand what the catch is if you set the text in the text editor id and the text is ok, but if through a variable, then an error.