Skip to content

Commit

Permalink
Merge branch 'hotfix/now-when-official-message-was-removed'
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigondec committed May 21, 2020
2 parents 0c9e9a6 + 0c56d39 commit 929609f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions db/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ def _send_update_message(self, update_message):
.objects(subject=subject,
observer=official_observer)\
.order_by('-datetime').first()
telegram_message = BotTelegramCore.forward_message(
to_chat_id=self.chat_id,
from_chat_id=official_observer.chat_id,
message_id=last_official_message.message_id
)
self._create_message(telegram_message.message_id, subject)
try:
telegram_message = BotTelegramCore.forward_message(
to_chat_id=self.chat_id,
from_chat_id=official_observer.chat_id,
message_id=last_official_message.message_id
)
self._create_message(telegram_message.message_id, subject)
except BadRequest:
last_official_message.delete()
update_message.delete()

0 comments on commit 929609f

Please sign in to comment.