@ave_code

Как решить ошибку AttributeError: 'BotCommand' object has no attribute 'write' в Pyrogram?

Всем привет. Есть простенький код.
Суть сводится к тому, чтобы создать бота на базе Pyrogram и установить в него ряд команд.
Но при установке выдаёт ошибку:
commands=[c.write() for c in commands]
AttributeError: 'BotCommand' object has no attribute 'write'


Дока: ссылка-->

Сам код:
bot_client = Client('new_session2', os.getenv("API_ID"),
                            os.getenv("API_HASH"), bot_token, parse_mode=ParseMode.HTML)
        bot_commands = [BotCommand(command='start_adsf', description='fffffff'),BotCommand(command='stop_adsf', description='rrrrrrrr')]
        await bot_client.start()
        await bot_client.set_bot_commands(bot_commands)
        await idle()
        await bot_client.stop()
  • Вопрос задан
  • 21 просмотр
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы