aiogram/docs2/source/api/methods/set_my_commands.rst
2020-06-15 02:22:24 +03:00

52 lines
No EOL
892 B
ReStructuredText

#############
setMyCommands
#############
Use this method to change the list of the bot's commands. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.api.methods.set_my_commands
:members:
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.set_my_commands(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods import SetMyCommands`
- :code:`from aiogram.api.methods import SetMyCommands`
- :code:`from aiogram.api.methods.set_my_commands import SetMyCommands`
In handlers with current bot
----------------------------
.. code-block::
result: bool = await SetMyCommands(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
result: bool = await bot(SetMyCommands(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
return SetMyCommands(...)