mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11:35 +00:00
Fix telegram bot
This commit is contained in:
parent
fbfa7a060b
commit
70fc02b242
@ -52,7 +52,6 @@ class Command(BaseCommand):
|
||||
self.notifications.send_telegram_message(
|
||||
result["message"]["from"]["id"],
|
||||
'You must enable the notifications bot using the RoboSats client. Click on your "Robot robot" -> "Enable Telegram" and follow the link or scan the QR code.',
|
||||
"",
|
||||
)
|
||||
continue
|
||||
token = parts[-1]
|
||||
@ -61,7 +60,6 @@ class Command(BaseCommand):
|
||||
self.notifications.send_telegram_message(
|
||||
result["message"]["from"]["id"],
|
||||
f'Wops, invalid token! There is no Robot with telegram chat token "{token}"',
|
||||
"",
|
||||
)
|
||||
continue
|
||||
|
||||
|
@ -37,13 +37,13 @@ class Notifications:
|
||||
if robot.telegram_enabled:
|
||||
self.send_telegram_message(robot.telegram_chat_id, title, description)
|
||||
|
||||
def save_message(self, order, robot, title, description):
|
||||
def save_message(self, order, robot, title, description=""):
|
||||
"""Save a message for a user"""
|
||||
Notification.objects.create(
|
||||
title=title, description=description, robot=robot, order=order
|
||||
)
|
||||
|
||||
def send_telegram_message(self, chat_id, title, description):
|
||||
def send_telegram_message(self, chat_id, title, description=""):
|
||||
"""sends a message to a user with telegram notifications enabled"""
|
||||
|
||||
bot_token = config("TELEGRAM_TOKEN")
|
||||
|
Loading…
Reference in New Issue
Block a user