mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
Notify coordinator admin for new disputes (#1204)
notify coordinator admin for new disputes
This commit is contained in:
parent
6a8b38154e
commit
22a93d630d
@ -65,6 +65,8 @@ ALTERNATIVE_NAME = 'RoboSats Mainnet'
|
|||||||
# Telegram bot token
|
# Telegram bot token
|
||||||
TELEGRAM_TOKEN = ''
|
TELEGRAM_TOKEN = ''
|
||||||
TELEGRAM_BOT_NAME = 'RoboCoordinatorNotificationBot'
|
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.
|
# 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
|
CHAT_NOTIFICATION_TIMEGAP = 5
|
||||||
|
|
||||||
|
@ -138,6 +138,15 @@ class Telegram:
|
|||||||
else:
|
else:
|
||||||
text = f"⚖️ Hey {user.username}, a dispute has been opened on your order with ID {str(order.id)}."
|
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)
|
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
|
return
|
||||||
|
|
||||||
def order_published(self, order):
|
def order_published(self, order):
|
||||||
|
Loading…
Reference in New Issue
Block a user