Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cctdaniel committed May 16, 2024
1 parent 6864423 commit 03280ec
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions pyth_observer/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,13 @@ async def send(self):
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}%"
)
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": formatted_message,
Expand Down

0 comments on commit 03280ec

Please sign in to comment.