Spaces:
No application file
No application file
alert_manager.py
Browse files# alert_manager.py
from alerts.telegram_bot import TelegramBot
import os
telegram = TelegramBot(
token=os.getenv("TELEGRAM_BOT_TOKEN"),
chat_id=os.getenv("TELEGRAM_CHAT_ID")
)
def notify_trade_success(token_address, amount, tx_hash):
message = f"✅ <b>Trade Successful</b>\nToken: {token_address}\nAmount: {amount} SOL\nTx: {tx_hash}"
telegram.send_message(message)
def notify_opportunity(token_address, probability):
message = f"🚀 <b>New Token Opportunity</b>\nToken: {token_address}\nPredicted Success Probability: {round(probability*100, 2)}%"
telegram.send_message(message)
- alert_manager.py +16 -0
alert_manager.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# alert_manager.py
|
| 2 |
+
from alerts.telegram_bot import TelegramBot
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
telegram = TelegramBot(
|
| 6 |
+
token=os.getenv("TELEGRAM_BOT_TOKEN"),
|
| 7 |
+
chat_id=os.getenv("TELEGRAM_CHAT_ID")
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
def notify_trade_success(token_address, amount, tx_hash):
|
| 11 |
+
message = f"✅ <b>Trade Successful</b>\nToken: {token_address}\nAmount: {amount} SOL\nTx: {tx_hash}"
|
| 12 |
+
telegram.send_message(message)
|
| 13 |
+
|
| 14 |
+
def notify_opportunity(token_address, probability):
|
| 15 |
+
message = f"🚀 <b>New Token Opportunity</b>\nToken: {token_address}\nPredicted Success Probability: {round(probability*100, 2)}%"
|
| 16 |
+
telegram.send_message(message)
|