Add new parameter getupdates_error_handler to Bot.run function#112
Add new parameter getupdates_error_handler to Bot.run function#112kian-ahmadian wants to merge 4 commits into
getupdates_error_handler to Bot.run function#112Conversation
getupdates_error_handler to Bot.run function
| startup_functions.append(self.get_me) | ||
| startup_functions.append(updater.setup) | ||
| operation_coroutine.append(updater.start_polling()) | ||
| operation_coroutine.append(updater.start_polling(getupdates_error_handler=getupdates_error_handler)) |
Check warning
Code scanning / Prospector (reported by Codacy)
Undefined variable 'getupdates_error_handler' (undefined-variable)
| return True | ||
|
|
||
| def getupdates_error(exc: Any) -> bool: | ||
| def default_getupdates_error_handler(exc: Any) -> bool: |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring
| self.__stop_worker_event = asyncio.Event() | ||
|
|
||
| async def start_polling(self): | ||
| async def start_polling(self, getupdates_error_handler: Callable[[Any], bool] = None): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing method docstring
|
|
||
| done = (await asyncio.wait([work_task, wait_stop_task], return_when=asyncio.FIRST_COMPLETED))[0] | ||
| done = ( | ||
| await asyncio.wait([work_task, wait_stop_task], return_when=asyncio.FIRST_COMPLETED) |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (104/100)
| if not self.current_offset or update.update_id > self.current_offset: | ||
| if ( | ||
| not self.current_offset or | ||
| update.update_id > self.current_offset # This is due to a bug sometimes caused by the Bale servers. |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (128/100)
|
|
||
| done = (await asyncio.wait([work_task, wait_stop_task], return_when=asyncio.FIRST_COMPLETED))[0] | ||
| done = ( | ||
| await asyncio.wait([work_task, wait_stop_task], return_when=asyncio.FIRST_COMPLETED) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (104/100)
| if not self.current_offset or update.update_id > self.current_offset: | ||
| if ( | ||
| not self.current_offset or | ||
| update.update_id > self.current_offset # This is due to a bug sometimes caused by the Bale servers. |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (128/100)
| self.__stop_worker_event = asyncio.Event() | ||
|
|
||
| async def start_polling(self): | ||
| async def start_polling(self, getupdates_error_handler: Callable[[Any], bool] = None): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring
| startup_functions.append(self.get_me) | ||
| startup_functions.append(updater.setup) | ||
| operation_coroutine.append(updater.start_polling()) | ||
| operation_coroutine.append(updater.start_polling(getupdates_error_handler=getupdates_error_handler)) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (112/100)
| startup_functions.append(self.get_me) | ||
| startup_functions.append(updater.setup) | ||
| operation_coroutine.append(updater.start_polling()) | ||
| operation_coroutine.append(updater.start_polling(getupdates_error_handler=getupdates_error_handler)) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Undefined variable 'getupdates_error_handler'
…dler` so that the updater continues.
getupdates_error_handlerto Bot.run functionupdate_iddefault_getupdates_error_handlerso that the updater continues.