Skip to content

Commit

Permalink
added error message for settings in private
Browse files Browse the repository at this point in the history
  • Loading branch information
ychebyshev committed Feb 22, 2024
1 parent 3af5ba6 commit 8927005
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/handlers/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from aiogram import Router, types
from aiogram import F, Router, types
from aiogram.filters import Command
from aiogram.utils.text_decorations import html_decoration as hd

Expand All @@ -17,6 +17,11 @@
router = Router(name=__name__)


@router.message(Command(commands="settings", prefix="!/"), F.chat.type == "private")
async def get_settings_private(message: types.Message):
await message.answer("Настройки поддерживаются только в групповых чатах")


@router.message(Command(commands="settings", prefix="!/"))
async def get_settings(message: types.Message, chat: Chat, chat_settings: ChatSettings):
settings_card = render_settings(chat_settings, chat)
Expand Down

0 comments on commit 8927005

Please sign in to comment.