Small fixes to new telegram implementation
This commit is contained in:
@@ -163,7 +163,7 @@ class Telegram(RPCHandler):
|
|||||||
registers all known command handlers
|
registers all known command handlers
|
||||||
and starts polling for message updates
|
and starts polling for message updates
|
||||||
"""
|
"""
|
||||||
self._app = Application.builder().token(self._config['telegram']['token']).build
|
self._app = Application.builder().token(self._config['telegram']['token']).build()
|
||||||
# self._updater = Updater(token=, workers=0,
|
# self._updater = Updater(token=, workers=0,
|
||||||
# use_context=True)
|
# use_context=True)
|
||||||
|
|
||||||
@@ -229,16 +229,16 @@ class Telegram(RPCHandler):
|
|||||||
for callback in callbacks:
|
for callback in callbacks:
|
||||||
self._app.add_handler(callback)
|
self._app.add_handler(callback)
|
||||||
|
|
||||||
self._app.run_polling(
|
|
||||||
bootstrap_retries=-1,
|
|
||||||
timeout=20,
|
|
||||||
read_latency=60, # Assumed transmission latency
|
|
||||||
drop_pending_updates=True,
|
|
||||||
)
|
|
||||||
logger.info(
|
logger.info(
|
||||||
'rpc.telegram is listening for following commands: %s',
|
'rpc.telegram is listening for following commands: %s',
|
||||||
[[x for x in sorted(h.commands)] for h in handles]
|
[[x for x in sorted(h.commands)] for h in handles]
|
||||||
)
|
)
|
||||||
|
self._app.run_polling(
|
||||||
|
bootstrap_retries=-1,
|
||||||
|
timeout=20,
|
||||||
|
# read_latency=60, # Assumed transmission latency
|
||||||
|
drop_pending_updates=True,
|
||||||
|
)
|
||||||
|
|
||||||
def cleanup(self) -> None:
|
def cleanup(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user