added default commands functionality
This commit is contained in:
parent
ea8e2bf764
commit
b026ab8aec
5
app.py
5
app.py
|
@ -3,8 +3,13 @@ from aiogram import executor
|
||||||
from loader import dp
|
from loader import dp
|
||||||
import middlewares, filters, handlers
|
import middlewares, filters, handlers
|
||||||
from utils.notify_admins import on_startup_notify
|
from utils.notify_admins import on_startup_notify
|
||||||
|
from utils.set_bot_commands import set_default_commands
|
||||||
|
|
||||||
|
|
||||||
async def on_startup(dispatcher):
|
async def on_startup(dispatcher):
|
||||||
|
# Устанавливаем дефолтные команды
|
||||||
|
await set_default_commands(dispatcher)
|
||||||
|
|
||||||
# Уведомляет про запуск
|
# Уведомляет про запуск
|
||||||
await on_startup_notify(dispatcher)
|
await on_startup_notify(dispatcher)
|
||||||
|
|
||||||
|
|
10
utils/set_bot_commands.py
Normal file
10
utils/set_bot_commands.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
from aiogram import types
|
||||||
|
|
||||||
|
|
||||||
|
async def set_default_commands(dp):
|
||||||
|
await dp.bot.set_my_commands(
|
||||||
|
[
|
||||||
|
types.BotCommand("start", "Запустить бота"),
|
||||||
|
types.BotCommand("help", "Вывести справку"),
|
||||||
|
]
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user