Retrieves any updates from the Telegram API. Registered listeners and applicable message handlers will be notified when a new message arrives. :meta private: :raises ApiException when a call has failed.
(self, timeout=20, long_polling_timeout=20, allowed_updates=None)
| 675 | self.get_updates(offset=-1) |
| 676 | |
| 677 | def __retrieve_updates(self, timeout=20, long_polling_timeout=20, allowed_updates=None): |
| 678 | """ |
| 679 | Retrieves any updates from the Telegram API. |
| 680 | Registered listeners and applicable message handlers will be notified when a new message arrives. |
| 681 | |
| 682 | :meta private: |
| 683 | |
| 684 | :raises ApiException when a call has failed. |
| 685 | """ |
| 686 | if self.skip_pending: |
| 687 | self.__skip_updates() |
| 688 | logger.debug('Skipped all pending messages') |
| 689 | self.skip_pending = False |
| 690 | updates = self.get_updates(offset=(self.last_update_id + 1), |
| 691 | allowed_updates=allowed_updates, |
| 692 | timeout=timeout, long_polling_timeout=long_polling_timeout) |
| 693 | self.process_new_updates(updates) |
| 694 | |
| 695 | def process_new_updates(self, updates: List[types.Update]): |
| 696 | """ |
no test coverage detected