Skip to content

Commit

Permalink
Merge branch 'main' into AA_zenduty-events
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazabbas authored May 16, 2024
2 parents 9558154 + c125d78 commit 57acddf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pyth_observer/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,17 @@ async def send(self):
telegram_api_url = (
f"https://api.telegram.org/bot{self.telegram_bot_token}/sendMessage"
)

formatted_message = ""
for key, value in text.items():
value_str = f"{value:.2f}%" if key == "deviation" else f"{value}"
formatted_message += (
f"*{key.capitalize().replace('_', ' ')}:* {value_str}\n"
)

message_data = {
"chat_id": chat_id,
"text": text,
"text": formatted_message,
"parse_mode": "Markdown",
}

Expand Down

0 comments on commit 57acddf

Please sign in to comment.