1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-12-15 14:26:16 +00:00

Возможность ограничивать права на бота

This commit is contained in:
mihalin
2021-10-01 19:48:23 +03:00
parent 5fcb5b8900
commit 1aeec0c9d8
5 changed files with 74 additions and 3 deletions

View File

@@ -3,7 +3,8 @@ import argparse
from tortoise import Tortoise
from olgram.router import dp
from olgram.settings import TORTOISE_ORM
from olgram.settings import TORTOISE_ORM, OlgramSettings
from olgram.utils.permissions import AccessMiddleware
from server.custom import init_redis
import olgram.commands.bots # noqa: F401
@@ -22,7 +23,8 @@ async def init_database():
async def init_olgram():
from olgram.router import bot
from olgram.router import bot, dp
dp.setup_middleware(AccessMiddleware(OlgramSettings.admin_id()))
from aiogram.types import BotCommand
await bot.set_my_commands(
[