summaryrefslogtreecommitdiff
path: root/include/py/homekit/telegram/bot.py
diff options
context:
space:
mode:
Diffstat (limited to 'include/py/homekit/telegram/bot.py')
-rw-r--r--include/py/homekit/telegram/bot.py29
1 files changed, 9 insertions, 20 deletions
diff --git a/include/py/homekit/telegram/bot.py b/include/py/homekit/telegram/bot.py
index 2e33bea..5ed8b06 100644
--- a/include/py/homekit/telegram/bot.py
+++ b/include/py/homekit/telegram/bot.py
@@ -21,12 +21,10 @@ from telegram.ext.filters import BaseFilter
from telegram.error import TimedOut
from homekit.config import config
-from homekit.api import WebApiClient
-from homekit.api.types import BotType
from ._botlang import lang, languages
from ._botdb import BotDatabase
-from ._botutil import ReportingHelper, exc2text, IgnoreMarkup, user_any_name
+from ._botutil import exc2text, IgnoreMarkup
from ._botcontext import Context
@@ -39,7 +37,6 @@ _cancel_and_back_filter = filters.Text(lang.all('back') + lang.all('cancel'))
_logger = logging.getLogger(__name__)
_application: Optional[Application] = None
-_reporting: Optional[ReportingHelper] = None
_exception_handler: Optional[Coroutine] = None
_dispatcher = None
_markup_getter: Optional[callable] = None
@@ -511,22 +508,14 @@ async def _default_any_handler(ctx: Context):
await ctx.reply(ctx.lang('invalid_command'))
-def _logging_message_handler(update: Update, context: CallbackContext):
- if _reporting:
- _reporting.report(update.message)
-
-
-def _logging_callback_handler(update: Update, context: CallbackContext):
- if _reporting:
- _reporting.report(update.callback_query.message, text=update.callback_query.data)
-
-
-def enable_logging(bot_type: BotType):
- api = WebApiClient(timeout=3)
- api.enable_async()
-
- global _reporting
- _reporting = ReportingHelper(api, bot_type)
+# def _logging_message_handler(update: Update, context: CallbackContext):
+# if _reporting:
+# _reporting.report(update.message)
+#
+#
+# def _logging_callback_handler(update: Update, context: CallbackContext):
+# if _reporting:
+# _reporting.report(update.callback_query.message, text=update.callback_query.data)
def notify_all(text_getter: callable,