mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Improved code readability x 2
This commit is contained in:
parent
b523cec22f
commit
2d1f39085d
@ -900,9 +900,9 @@ class TeleBot:
|
|||||||
path = sys.argv[sys.argv.index('--path') + 1] if '--path' in sys.argv else '.'
|
path = sys.argv[sys.argv.index('--path') + 1] if '--path' in sys.argv else '.'
|
||||||
|
|
||||||
|
|
||||||
self.observer = Observer()
|
self.event_observer = Observer()
|
||||||
self.observer.schedule(self.event_handler, path, recursive=True)
|
self.event_observer.schedule(self.event_handler, path, recursive=True)
|
||||||
self.observer.start()
|
self.event_observer.start()
|
||||||
|
|
||||||
def infinity_polling(self, timeout: Optional[int]=20, skip_pending: Optional[bool]=False, long_polling_timeout: Optional[int]=20,
|
def infinity_polling(self, timeout: Optional[int]=20, skip_pending: Optional[bool]=False, long_polling_timeout: Optional[int]=20,
|
||||||
logger_level: Optional[int]=logging.ERROR, allowed_updates: Optional[List[str]]=None,
|
logger_level: Optional[int]=logging.ERROR, allowed_updates: Optional[List[str]]=None,
|
||||||
|
@ -233,9 +233,9 @@ class AsyncTeleBot:
|
|||||||
# Make it possible to specify --path argument to the script
|
# Make it possible to specify --path argument to the script
|
||||||
path = sys.argv[sys.argv.index('--path') + 1] if '--path' in sys.argv else '.'
|
path = sys.argv[sys.argv.index('--path') + 1] if '--path' in sys.argv else '.'
|
||||||
|
|
||||||
self.observer = Observer()
|
self.event_observer = Observer()
|
||||||
self.observer.schedule(self.event_handler, path, recursive=True)
|
self.event_observer.schedule(self.event_handler, path, recursive=True)
|
||||||
self.observer.start()
|
self.event_observer.start()
|
||||||
|
|
||||||
async def polling(self, non_stop: bool=False, skip_pending=False, interval: int=0, timeout: int=20,
|
async def polling(self, non_stop: bool=False, skip_pending=False, interval: int=0, timeout: int=20,
|
||||||
request_timeout: Optional[int]=None, allowed_updates: Optional[List[str]]=None,
|
request_timeout: Optional[int]=None, allowed_updates: Optional[List[str]]=None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user