Notify coordinator admin for new disputes (#1204)

notify coordinator admin for new disputes
This commit is contained in:
KoalaSat 2024-03-28 02:23:24 +01:00 committed by GitHub
parent 6a8b38154e
commit 22a93d630d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,8 @@ ALTERNATIVE_NAME = 'RoboSats Mainnet'
# Telegram bot token
TELEGRAM_TOKEN = ''
TELEGRAM_BOT_NAME = 'RoboCoordinatorNotificationBot'
# Telegram chat id to receive admin notifications
TELEGRAM_COORDINATOR_CHAT_ID = 'AdminNotificationChatId'
# Notify new messages in-chat app (fiat exchange step) if at least X minutes has passed since the last chat message.
CHAT_NOTIFICATION_TIMEGAP = 5

View File

@ -138,6 +138,15 @@ class Telegram:
else:
text = f"⚖️ Hey {user.username}, a dispute has been opened on your order with ID {str(order.id)}."
self.send_message(user.robot.telegram_chat_id, text)
admin_chat_id = config("TELEGRAM_ADMIN_CHAT_ID")
if len(admin_chat_id) == 0:
return
coordinator_text = f"There is a new dispute opened for the order with ID {str(order.id)}. Visit http://{self.site}/coordinator/api/order/{str(order.id)}/change to proceed."
self.send_message(admin_chat_id, coordinator_text)
return
def order_published(self, order):