xync-bot 0.3.27__py3-none-any.whl → 0.3.28__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.

Potentially problematic release.


This version of xync-bot might be problematic. Click here for more details.

xync_bot/__init__.py ADDED
@@ -0,0 +1,28 @@
1
+ from PGram import Bot
2
+ from aiogram.client.default import DefaultBotProperties
3
+ from aiogram.enums import UpdateType
4
+
5
+ from xync_bot.store import Store
6
+ from xync_bot.routers import last
7
+ from xync_bot.routers.main.handler import mr
8
+ from xync_bot.routers.pay.handler import pr
9
+ from xync_bot.routers.cond import cr
10
+ from xync_bot.routers.send import sd
11
+
12
+
13
+ au = [
14
+ UpdateType.MESSAGE,
15
+ UpdateType.CALLBACK_QUERY,
16
+ UpdateType.CHAT_MEMBER,
17
+ UpdateType.MY_CHAT_MEMBER,
18
+ ] # , UpdateType.CHAT_JOIN_REQUEST
19
+
20
+
21
+ class XyncBot(Bot):
22
+ def __init__(self, token, cn):
23
+ super().__init__(token, cn, [sd, cr, pr, mr, last], Store(), DefaultBotProperties(parse_mode="HTML"))
24
+
25
+ async def start(self, wh_host: str = None):
26
+ await super().start(au, wh_host)
27
+ self.dp.workflow_data["store"].glob = await Store.Global() # todo: refact store loading
28
+ return self
xync_bot/__main__.py CHANGED
@@ -3,7 +3,6 @@ from asyncio import run
3
3
 
4
4
  from PGram import Bot
5
5
  from aiogram.client.default import DefaultBotProperties
6
- from aiogram.enums import UpdateType
7
6
  from x_model import init_db
8
7
 
9
8
  from xync_bot.store import Store
@@ -12,26 +11,19 @@ from xync_bot.routers.cond import cr
12
11
  from xync_bot.routers.pay.handler import pr
13
12
  from xync_bot.routers import last
14
13
  from xync_bot.routers.send import sd
14
+ from xync_bot.loader import TOKEN
15
15
 
16
- au = [
17
- UpdateType.MESSAGE,
18
- UpdateType.CALLBACK_QUERY,
19
- UpdateType.CHAT_MEMBER,
20
- UpdateType.MY_CHAT_MEMBER,
21
- ] # , UpdateType.CHAT_JOIN_REQUEST
22
- bot = Bot([sd, cr, pr, mr, last], Store(), au, default=DefaultBotProperties(parse_mode="HTML"))
23
16
 
24
17
  if __name__ == "__main__":
25
- from xync_bot.loader import TOKEN, TORM
18
+ from xync_bot.loader import TORM
26
19
 
27
20
  logging.basicConfig(level=logging.INFO)
28
21
 
29
22
  async def main() -> None:
30
23
  cn = await init_db(TORM)
24
+ bot = Bot(TOKEN, cn, [sd, cr, pr, mr, last], DefaultBotProperties(parse_mode="HTML"))
25
+
26
+ await bot.start()
31
27
  bot.dp.workflow_data["store"].glob = await Store.Global() # todo: refact store loading
32
- await bot.start(
33
- TOKEN,
34
- cn,
35
- )
36
28
 
37
29
  run(main())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-bot
3
- Version: 0.3.27
3
+ Version: 0.3.28
4
4
  Summary: Telegram bot with web app for xync net
5
5
  Author-email: Artemiev <mixartemev@gmail.com>
6
6
  License-Expression: GPL-3.0-or-later
@@ -1,4 +1,5 @@
1
- xync_bot/__main__.py,sha256=uZH7tEJ1GQtLMKYG9ttiI6mTyXvLCs5bc_JiQd_2I0o,1032
1
+ xync_bot/__init__.py,sha256=ym2KZJTTmwo_ijtjHfHqxJubONva37Xo9nnF24Xo8H0,879
2
+ xync_bot/__main__.py,sha256=zxUZaz35JqPAD-jiz-z6Pw8ndIsmboKKhODmvRhIEiU,820
2
3
  xync_bot/loader.py,sha256=4ZeR-yVMoOmswdLS0UEBG19K7JVcuvH6WpP-_0yAK3I,573
3
4
  xync_bot/shared.py,sha256=PPzvt1ewowCInKE1bk2CWHPjnrV2eQJzKxgyxe3h7vk,496
4
5
  xync_bot/store.py,sha256=zLpn3aQArTx5WxYwg11UR7-y9_rgXkF0sIeoG-jyPp8,6266
@@ -17,7 +18,7 @@ xync_bot/routers/pay/dep.py,sha256=WvIkLsMHsy6Z8qeQYB0uvHi9xgJ-pCjRad0dSp_GQS0,3
17
18
  xync_bot/routers/pay/handler.py,sha256=mvxubzZ6BipmmPcvQC2MPl-66doZcFoU7kYmshHBjLo,10677
18
19
  xync_bot/routers/pay/window.py,sha256=YKRwhw6J7gQVABgVEgUs-JmpvGoEyKMgbPtSCnuXQmE,11163
19
20
  xync_bot/routers/send/__init__.py,sha256=Mccf__w_nF7CbDN7gndqXEQ985oCcKX4j7NCcgvq2Ok,3793
20
- xync_bot-0.3.27.dist-info/METADATA,sha256=JF2m7KoPXK5szEa0Rb-894UnYGCes6SZd5kD3FgfVLA,746
21
- xync_bot-0.3.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- xync_bot-0.3.27.dist-info/top_level.txt,sha256=O2IjMc1ryAf0rwIXWohSNT5Kzcs9johgKRDz8lCC0rs,9
23
- xync_bot-0.3.27.dist-info/RECORD,,
21
+ xync_bot-0.3.28.dist-info/METADATA,sha256=2UhWXod8TEGwJpNYiZEnFkauJdzv_U8D__K51-2ooyY,746
22
+ xync_bot-0.3.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ xync_bot-0.3.28.dist-info/top_level.txt,sha256=O2IjMc1ryAf0rwIXWohSNT5Kzcs9johgKRDz8lCC0rs,9
24
+ xync_bot-0.3.28.dist-info/RECORD,,