Advertisement
l1von

cerf

Dec 14th, 2020
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. @bot.on.chat_invite()
  2. async def invite(message: Message):
  3. dialog_filename = f"{dir_to_txt}{message.peer_id}.txt"
  4. picture_filename = f"{dir_to_pic}{message.peer_id}.txt"
  5. keyboard = keyboard_gen(
  6. [
  7. [{"text": "Добавить в чат", "color": "negative"}],
  8. [{"type": "open_app", "app_id": 6441755, "owner_id": -200925480, "hash": "anything_data_100500"}],
  9. ],
  10. inline=True
  11. )
  12. if not os.path.exists(dialog_filename):
  13. open(dialog_filename, "w").close()
  14. if not os.path.exists(picture_filename):
  15. open(picture_filename, "w").close()
  16. await message(hello_message, keyboard=keyboard)
  17.  
  18.  
  19. ОШИБКА:
  20. [VKBottle] While parent_processor was handling error occurred
  21.  
  22. Traceback (most recent call last):
  23. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\framework\framework\swear_handler.py", line 26, in wrapper
  24. return await func(*args, **kwargs)
  25. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\framework\bot\processor.py", line 35, in parent_processor
  26. return await self.message_processor(obj, client_info)
  27. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\framework\bot\processor.py", line 81, in message_processor
  28. task = await rules[0].call(*args, **kwargs)
  29. File "main.py", line 93, in invite
  30. await message(hello_message, keyboard=keyboard)
  31. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\types\message.py", line 93, in __call__
  32. **self.get_params(locals()), peer_id=self.peer_id,
  33. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\types\methods\messages.py", line 1110, in __call__
  34. "messages.send", params, response_model=responses.messages.SendModel
  35. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\api\api\request.py", line 31, in __call__
  36. error_handler=self.error_handler,
  37. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\api\api\util\requester.py", line 68, in request
  38. return await error_handler.handle_error(exception)
  39. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\api\api\error_handler\error_handler.py", line 28, in handle_error
  40. return await self.unhandled_error(e)
  41. File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\vkbottle\api\api\error_handler\error_handler.py", line 58, in unhandled_error
  42. raise e
  43. vkbottle.utils.exceptions.VKError: (911, 'Keyboard format is invalid: button [1][0] label is required', <Method MessagesSend>, {'random_id': -129278274, 'peer_id': 2000000048, 'message': 'дарова я нейробред\nя рандомно высираю демотиваторы, беру ваши сообщения и картинки, которые вы отправляете\nотвечаю на @neurobred или дем или d или / если выдана переписка\nне забудьте выдать доступ к переписке или админку, а то бот будет игнорить\n"помощь" - команды бота\nF.A.Q - https://vk.com/@neurobred-faq\n', 'keyboard': '{"one_time":false,"buttons":[[{"action":{"type":"text","label":"\\u0414\\u043e\\u0431\\u0430\\u0432\\u0438\\u0442\\u044c \\u0432 \\u0447\\u0430\\u0442"},"color":"negative"}],[{"action":{"type":"open_app","app_id":6441755,"owner_id":-200925480,"hash":"anything_data_100500"}}]],"inline":true}'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement