Skip to content

Commit

Permalink
format telegram message
Browse files Browse the repository at this point in the history
  • Loading branch information
cctdaniel committed May 16, 2024
1 parent 2a6dc76 commit 8a393e0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pyth_observer/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,19 @@ async def send(self):
telegram_api_url = (
f"https://api.telegram.org/bot{self.telegram_bot_token}/sendMessage"
)

formatted_message = (
f"*Message:* {text['msg']}\n"
f"*Type:* {text['type']}\n"
f"*Publisher:* {text['publisher']}\n"
f"*Symbol:* {text['symbol']}\n"
f"*Publisher Price:* {text['publisher_price']}\n"
f"*Aggregate Price:* {text['aggregate_price']}\n"
f"*Deviation:* {text['deviation']:.2f}%"
)
message_data = {
"chat_id": chat_id,
"text": text,
"text": formatted_message,
"parse_mode": "Markdown",
}

Expand Down

0 comments on commit 8a393e0

Please sign in to comment.