arpakitlib 1.8.142__py3-none-any.whl → 1.8.143__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,14 @@
1
1
  import aiogram
2
+ import telebot
2
3
  from aiogram.client.default import DefaultBotProperties
3
4
  from aiogram.client.session.aiohttp import AiohttpSession
4
5
  from aiogram.enums import ParseMode
5
6
 
6
7
  from project.core.settings import get_cached_settings
8
+ from project.core.util import setup_logging
7
9
 
8
10
 
9
- def create_tg_bot_notifier() -> aiogram.Bot | None:
11
+ def create_async_tg_bot_notifier() -> aiogram.Bot | None:
10
12
  if get_cached_settings().tg_bot_notifier_token is None:
11
13
  return None
12
14
  session: AiohttpSession | None = None
@@ -22,3 +24,25 @@ def create_tg_bot_notifier() -> aiogram.Bot | None:
22
24
  session=session
23
25
  )
24
26
  return tg_bot
27
+
28
+
29
+ def create_tg_bot_notifier() -> telebot.TeleBot | None:
30
+ if not get_cached_settings().tg_bot_notifier_token:
31
+ return None
32
+
33
+ if get_cached_settings().tg_bot_notifier_proxy_url is not None:
34
+ telebot.apihelper.proxy = {
35
+ "https": get_cached_settings().tg_bot_notifier_proxy_url,
36
+ "http": get_cached_settings().tg_bot_notifier_proxy_url
37
+ }
38
+
39
+ return telebot.TeleBot(get_cached_settings().tg_bot_notifier_token, parse_mode="HTML")
40
+
41
+
42
+ def __example():
43
+ setup_logging()
44
+ create_tg_bot_notifier().send_message(chat_id=269870432, text="Hello world")
45
+
46
+
47
+ if __name__ == '__main__':
48
+ __example()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arpakitlib
3
- Version: 1.8.142
3
+ Version: 1.8.143
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
6
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
@@ -353,7 +353,7 @@ arpakitlib/_arpakit_project_template_v_5/project/tg_bot/util/notify_admins.py,sh
353
353
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot/util/set_tg_bot_commands.py,sha256=eTVOpwp8zn74QhLgmbLkxn3cH4xPzQN02euS-7UP-Eg,3489
354
354
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot_notifier/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
355
355
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot_notifier/blank.py,sha256=0rspOC-xS9qdQ58pAJI-tNTgbylQIXCrEr79MMgvU1k,406
356
- arpakitlib/_arpakit_project_template_v_5/project/tg_bot_notifier/tg_bot_notifier.py,sha256=9JbalZDmR4a2cqPe9rB_KnUX7YibVC6S5wTHma9G7AI,843
356
+ arpakitlib/_arpakit_project_template_v_5/project/tg_bot_notifier/tg_bot_notifier.py,sha256=QMVOgvW4xJvi46vsdpw27IDrmI76W_Go_GJFUCvHfAc,1552
357
357
  arpakitlib/_arpakit_project_template_v_5/project/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
358
358
  arpakitlib/_arpakit_project_template_v_5/project/util/arpakitlib_project_template_util.py,sha256=syA_IuszHVub0zm0sVdB4_7rPJXwXRW4JmQ4qHbjXPk,396
359
359
  arpakitlib/_arpakit_project_template_v_5/project/util/etc.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -405,8 +405,8 @@ arpakitlib/ar_ssh_runner_util.py,sha256=yvAwza480MkHKvLkDEsR7JNh2bYNs6P9rCVo4NA8
405
405
  arpakitlib/ar_str_util.py,sha256=2lGpnXDf2h1cBZpVf5i1tX_HCv5iBd6IGnrCw4QWWlY,4350
406
406
  arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
407
407
  arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
408
- arpakitlib-1.8.142.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
409
- arpakitlib-1.8.142.dist-info/METADATA,sha256=PpYL6TGdfuz4basK1qZQrqSMbue1wZtRc9eyGSQ8sRw,3660
410
- arpakitlib-1.8.142.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
411
- arpakitlib-1.8.142.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
412
- arpakitlib-1.8.142.dist-info/RECORD,,
408
+ arpakitlib-1.8.143.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
409
+ arpakitlib-1.8.143.dist-info/METADATA,sha256=4gQpoKodyOIsSa8mC5oZIOzNhQ1enpSFYYVpX3O9p14,3660
410
+ arpakitlib-1.8.143.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
411
+ arpakitlib-1.8.143.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
412
+ arpakitlib-1.8.143.dist-info/RECORD,,