Skip to content

Commit

Permalink
merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
acruxtech committed Feb 18, 2025
2 parents 755cfce + 8c499ca commit 745d5bb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ __pycache__/
# C extensions
*.so

/volume

# Distribution / packaging
.Python
build/
Expand Down
21 changes: 20 additions & 1 deletion core/handlers/student.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import ChatTypeFilter, IsReplyFilter
from aiogram.types import Message, ReplyKeyboardRemove, ParseMode, ChatType
from aiogram.types import Message, ReplyKeyboardRemove, ParseMode, ChatType, ContentType

from core import texts
from core import states
Expand Down Expand Up @@ -49,6 +49,25 @@ async def send_create_ticket(message: Message):
)
await states.Registration.create_ticket.set()

@dp.message_handler(content_types=[
ContentType.AUDIO,
ContentType.DOCUMENT,
ContentType.PHOTO,
ContentType.STICKER,
ContentType.VIDEO,
ContentType.VOICE,
ContentType.LOCATION,
ContentType.CONTACT,
ContentType.POLL,
ContentType.DICE,
ContentType.VIDEO_NOTE,
ContentType.ANIMATION, #GIF
], state="*")
async def handle_no_text(message:Message):
await message.answer(
texts.errors.message_no_text,
parse_mode=ParseMode.HTML
)

@dp.message_handler(ChatTypeFilter(ChatType.PRIVATE), IsReplyFilter(is_reply=True), state="*")
async def handle_student_answer(message: Message, store: Storage):
Expand Down
3 changes: 3 additions & 0 deletions core/texts/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@

no_ticket = \
"Тикета с таким id нет"

message_no_text = \
"В данный момент BMSTU Direct поддерживает только текстовый формат сообщений. Отправка фото, видео и других файлов пока недоступна"

0 comments on commit 745d5bb

Please sign in to comment.