Template
mirror of
https://github.com/djimboy/djimbo_template_aio3.git
synced 2026-08-26 15:07:43 +00:00
Update
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# - *- coding: utf- 8 - *-
|
||||
from aiogram import Bot
|
||||
from aiogram.types import BotCommand, BotCommandScopeChat, BotCommandScopeDefault
|
||||
|
||||
from tgbot.config import get_admins
|
||||
|
||||
# Команды для юзеров
|
||||
user_commands = [
|
||||
BotCommand(command="start", description="♻ Перезапустить бота"),
|
||||
BotCommand(command="inline", description="🌀 Получить Inline клавиатуру"),
|
||||
]
|
||||
|
||||
# Команды для админов
|
||||
admin_commands = [
|
||||
BotCommand(command="start", description="♻ Перезапустить бота"),
|
||||
BotCommand(command="inline", description="🌀 Получить Inline клавиатуру"),
|
||||
BotCommand(command="log", description="🖨 Получить Логи"),
|
||||
BotCommand(command="db", description="📦 Получить Базу Данных"),
|
||||
]
|
||||
|
||||
|
||||
# Установка команд
|
||||
async def set_commands(bot: Bot):
|
||||
await bot.set_my_commands(user_commands, scope=BotCommandScopeDefault())
|
||||
|
||||
for admin in get_admins():
|
||||
try:
|
||||
await bot.set_my_commands(admin_commands, scope=BotCommandScopeChat(chat_id=admin))
|
||||
except:
|
||||
pass
|
||||
Reference in New Issue
Block a user