Files
Touchh/bot/operations/froud_notify.py
2024-12-09 17:42:23 +09:00

17 lines
670 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 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)