Froud
This commit is contained in:
16
bot/operations/froud_notify.py
Normal file
16
bot/operations/froud_notify.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from telegram import Bot
|
||||
|
||||
async def notify_fraud(hotel, fraud_logs):
|
||||
"""
|
||||
Уведомляет о FRAUD-действиях через Telegram.
|
||||
:param hotel: Отель, для которого обнаружены FRAUD-действия.
|
||||
:param fraud_logs: Список записей о FRAUD.
|
||||
"""
|
||||
bot = Bot(token="TELEGRAM_BOT_TOKEN")
|
||||
admin_chat_id = "ADMIN_CHAT_ID"
|
||||
|
||||
message = f"🚨 FRAUD обнаружен для отеля {hotel.name}:\n"
|
||||
for log in fraud_logs:
|
||||
message += f"- Гость: {log.guest_name}, Дата заезда: {log.check_in_date}\n"
|
||||
|
||||
await bot.send_message(chat_id=admin_chat_id, text=message)
|
||||
Reference in New Issue
Block a user