mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11:35 +00:00
Fix some TG messages do not arrive
This commit is contained in:
parent
e6600063ab
commit
8ca497f7b4
@ -35,13 +35,13 @@ class Telegram():
|
||||
message_url = f'https://api.telegram.org/bot{bot_token}/sendMessage?chat_id={chat_id}&text={text}'
|
||||
|
||||
# telegram messaging is atm inserted dangerously in the logics module
|
||||
# if it fails, it should just keep going
|
||||
try:
|
||||
self.session.get(message_url).json()
|
||||
except:
|
||||
pass
|
||||
|
||||
return
|
||||
# if it fails, it should keep trying
|
||||
while True:
|
||||
try:
|
||||
self.session.get(message_url).json()
|
||||
return
|
||||
except:
|
||||
pass
|
||||
|
||||
def welcome(self, user):
|
||||
lang = user.profile.telegram_lang_code
|
||||
@ -151,7 +151,7 @@ class Telegram():
|
||||
def order_published(self, order):
|
||||
|
||||
time.sleep(1) # Just so this message always arrives after the previous two
|
||||
|
||||
|
||||
user = order.maker
|
||||
lang = user.profile.telegram_lang_code
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user