1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-12-17 05:26:18 +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

@@ -6,11 +6,13 @@ from aiogram import types
from aiogram.dispatcher import FSMContext
from textwrap import dedent
from olgram.settings import OlgramSettings
from olgram.utils.permissions import public
from olgram.router import dp
@dp.message_handler(commands=["start"], state="*")
@public()
async def start(message: types.Message, state: FSMContext):
"""
Команда /start
@@ -33,6 +35,7 @@ async def start(message: types.Message, state: FSMContext):
@dp.message_handler(commands=["help"], state="*")
@public()
async def help(message: types.Message, state: FSMContext):
"""
Команда /help
@@ -42,3 +45,12 @@ async def help(message: types.Message, state: FSMContext):
Техническая поддержка: @civsocit_feedback_bot
Версия {OlgramSettings.version()}
"""))
@dp.message_handler(commands=["chatid"], state="*")
@public()
async def chat_id(message: types.Message, state: FSMContext):
"""
Команда /chatid
"""
await message.answer(message.chat.id)