aboutsummaryrefslogtreecommitdiff
path: root/inverter-bot
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-16 15:18:59 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-16 15:18:59 +0300
commit83464d3ce891eabc51b50d2375760044c2f641eb (patch)
tree2611dd659271b8acc943e23388379bbe72dcc6c0 /inverter-bot
parent7129b9af567f61ab4aa21503a58288fef3818fe5 (diff)
parent302b3a78bd7a61be877daa66f81d406189b7ef62 (diff)
Merge branch 'master' into shell-backdoor
Diffstat (limited to 'inverter-bot')
-rwxr-xr-xinverter-bot16
1 files changed, 11 insertions, 5 deletions
diff --git a/inverter-bot b/inverter-bot
index f888b6b..a101ed5 100755
--- a/inverter-bot
+++ b/inverter-bot
@@ -21,6 +21,7 @@ from telegram.ext import (
MessageHandler,
CallbackContext
)
+from telegram.error import TimedOut
class InverterClientWrapper:
@@ -121,7 +122,8 @@ def msg_status(update: Update, context: CallbackContext) -> None:
reply(update, html)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_shell(update: Update, context: CallbackContext) -> None:
@@ -185,7 +187,8 @@ def msg_generation(update: Update, context: CallbackContext) -> None:
reply(update, html)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_gs(update: Update, context: CallbackContext) -> None:
@@ -194,7 +197,8 @@ def msg_gs(update: Update, context: CallbackContext) -> None:
reply(update, status)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_ri(update: Update, context: CallbackContext) -> None:
@@ -203,7 +207,8 @@ def msg_ri(update: Update, context: CallbackContext) -> None:
reply(update, rated)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_errors(update: Update, context: CallbackContext) -> None:
@@ -212,7 +217,8 @@ def msg_errors(update: Update, context: CallbackContext) -> None:
reply(update, errors)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_all(update: Update, context: CallbackContext) -> None: