summaryrefslogtreecommitdiff
path: root/telegram_bot
diff options
context:
space:
mode:
Diffstat (limited to 'telegram_bot')
-rw-r--r--telegram_bot/__init__.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/telegram_bot/__init__.py b/telegram_bot/__init__.py
index 1c68ade..5e3d455 100644
--- a/telegram_bot/__init__.py
+++ b/telegram_bot/__init__.py
@@ -22,13 +22,12 @@ class TelegramBot:
raise AssertionError("Please configure TELEBOT_BOT_TOKEN as environment variables")
self.__bot = telebot.async_telebot.AsyncTeleBot(
- token=os.environ["TELEBOT_BOT_TOKEN"],
- exception_handler=ExceptionHandler())
+ token=os.environ["TELEBOT_BOT_TOKEN"])
async def run(self):
await self.__bot.polling(
non_stop=True,
- timeout=100
+ timeout=500
)
def register_command_handler(self, command: str, command_handler: CommandHandler):
@@ -52,10 +51,4 @@ class TelegramBot:
await self.__bot.reply_to(
message,
message_text,
- parse_mode='MarkdownV2')
-
-class ExceptionHandler(telebot.ExceptionHandler):
- def handle(self, exception):
- logging.error('TeleBot exception happened: {}'.format(str(exception)))
- logging.error(traceback.format_exc())
- return True \ No newline at end of file
+ parse_mode='MarkdownV2') \ No newline at end of file