summaryrefslogtreecommitdiff
path: root/include/py/homekit/telegram/_botutil.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-06-11 02:07:51 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-06-11 02:07:51 +0300
commit1d0b9c5d1c90c4f7c7a6eb0c3cf32ffb843f2533 (patch)
treeeca16553441cbaf89db54ac6e0ad4d8ccc831c4a /include/py/homekit/telegram/_botutil.py
parent00b3cd120f6357a35ef7e8b1c3ffad458a068266 (diff)
telegram bots: get rid of requests logging via webapi
Diffstat (limited to 'include/py/homekit/telegram/_botutil.py')
-rw-r--r--include/py/homekit/telegram/_botutil.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/include/py/homekit/telegram/_botutil.py b/include/py/homekit/telegram/_botutil.py
index 111a704..4fbbf28 100644
--- a/include/py/homekit/telegram/_botutil.py
+++ b/include/py/homekit/telegram/_botutil.py
@@ -3,9 +3,6 @@ import traceback
from html import escape
from telegram import User
-from homekit.api import WebApiClient as APIClient
-from homekit.api.types import BotType
-from homekit.api.errors import ApiResponseError
_logger = logging.getLogger(__name__)
@@ -24,20 +21,6 @@ def user_any_name(user: User) -> str:
return name
-class ReportingHelper:
- def __init__(self, client: APIClient, bot_type: BotType):
- self.client = client
- self.bot_type = bot_type
-
- def report(self, message, text: str = None) -> None:
- if text is None:
- text = message.text
- try:
- self.client.log_bot_request(self.bot_type, message.chat_id, text)
- except ApiResponseError as error:
- _logger.exception(error)
-
-
def exc2text(e: Exception) -> str:
tb = ''.join(traceback.format_tb(e.__traceback__))
return f'{e.__class__.__name__}: ' + escape(str(e)) + "\n\n" + escape(tb)