Files
shveitechbot/handlers/client/security.py

21 lines
733 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from aiogram import Router, F
from aiogram.enums import MessageOriginType
from aiogram.types import Message
from config import VERIFIED_ACCOUNTS
router = Router()
@router.message(F.forward_origin)
async def security_check(msg: Message):
if (
msg.forward_origin.type == MessageOriginType.USER
and msg.forward_origin.sender_user.id in VERIFIED_ACCOUNTS
):
text = "🍃 Вы общаетесь с оффициальным аккаунтом Екатерины."
else:
text = "<b>❌ Вы общаетесь с подставным лицом. Мы советуем закончить диалог с мошенником как можно быстрее.</b>"
await msg.answer(text)