xync-bot 0.3.26__tar.gz → 0.3.27__tar.gz

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.

Files changed (33) hide show
  1. {xync_bot-0.3.26/xync_bot.egg-info → xync_bot-0.3.27}/PKG-INFO +1 -1
  2. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/main/handler.py +39 -41
  3. {xync_bot-0.3.26 → xync_bot-0.3.27/xync_bot.egg-info}/PKG-INFO +1 -1
  4. {xync_bot-0.3.26 → xync_bot-0.3.27}/.env.dist +0 -0
  5. {xync_bot-0.3.26 → xync_bot-0.3.27}/.gitignore +0 -0
  6. {xync_bot-0.3.26 → xync_bot-0.3.27}/.pre-commit-config.yaml +0 -0
  7. {xync_bot-0.3.26 → xync_bot-0.3.27}/makefile +0 -0
  8. {xync_bot-0.3.26 → xync_bot-0.3.27}/pager.py +0 -0
  9. {xync_bot-0.3.26 → xync_bot-0.3.27}/pyproject.toml +0 -0
  10. {xync_bot-0.3.26 → xync_bot-0.3.27}/setup.cfg +0 -0
  11. {xync_bot-0.3.26 → xync_bot-0.3.27}/test_main.http +0 -0
  12. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/__main__.py +0 -0
  13. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/loader.py +0 -0
  14. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/__init__.py +0 -0
  15. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/cond/__init__.py +0 -0
  16. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/cond/func.py +0 -0
  17. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/main/__init__.py +0 -0
  18. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/order.py +0 -0
  19. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/pay/cd.py +0 -0
  20. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/pay/dep.py +0 -0
  21. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/pay/handler.py +0 -0
  22. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/pay/window.py +0 -0
  23. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/photo.py +0 -0
  24. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/send/__init__.py +0 -0
  25. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/vpn.py +0 -0
  26. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/xicon.png +0 -0
  27. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/shared.py +0 -0
  28. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/store.py +0 -0
  29. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/typs.py +0 -0
  30. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot.egg-info/SOURCES.txt +0 -0
  31. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot.egg-info/dependency_links.txt +0 -0
  32. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot.egg-info/requires.txt +0 -0
  33. {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-bot
3
- Version: 0.3.26
3
+ Version: 0.3.27
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
@@ -16,10 +16,13 @@ from aiogram.utils.deep_linking import create_start_link
16
16
  from xync_schema import models
17
17
 
18
18
  from xync_bot.shared import NavCallbackData
19
- from xync_bot.store import Store
20
19
 
21
20
  mr = Router(name="main")
22
21
 
22
+ txt = "Добро пожаловать в XyncPay, приветственный бонус: комиссия 0% на первые $10 000"
23
+ url = "https://pay.xync.net"
24
+ rm = InlineKeyboardMarkup(inline_keyboard=[[InlineKeyboardButton(text="Pay", web_app=WebAppInfo(url=url))]])
25
+
23
26
 
24
27
  class RrCallbackData(CallbackData, prefix="reg_res"): # registration response
25
28
  to: int
@@ -37,54 +40,49 @@ home_btns = InlineKeyboardMarkup(
37
40
  )
38
41
 
39
42
 
40
- @mr.message(CommandStart(deep_link=True, deep_link_encoded=True))
41
- async def start_handler(msg: Message, command: CommandObject):
42
- me: User = msg.from_user
43
- ref_id: int = command.args.isnumeric() and int(command.args)
44
- user = await models.User.get(username_id=me.id, blocked=False)
45
- rm = None
46
- logging.info(msg, {"src": "start"})
47
- if user:
48
- rs, rm = f"{me.full_name}, you have registered already😉", home_btns
49
- elif not (ref := await models.User.get_or_none(id=ref_id)):
50
- rs = f"No registered user #{ref_id}😬"
51
- else: # new user created
52
- user, cr = await models.User.tg2in(me, False)
53
- await user.update_from_dict({"ref": ref}).save()
54
- approve_btns = InlineKeyboardMarkup(
55
- inline_keyboard=[
56
- [
57
- InlineKeyboardButton(text="Отклонить", callback_data=RrCallbackData(to=user.id, res=False).pack()),
58
- InlineKeyboardButton(text="Одобрить", callback_data=RrCallbackData(to=user.id, res=True).pack()),
59
- ]
60
- ]
61
- )
62
- await msg.bot.send_message(
63
- ref.id, f"{me.full_name} просит что б Вы взяли за него/ее ответственность", reply_markup=approve_btns
64
- )
65
- return await msg.answer(f"Please wait for @{ref.username} approving...")
66
- return await msg.answer(rs, reply_markup=rm)
43
+ # @mr.message(CommandStart(deep_link=True, deep_link_encoded=True))
44
+ # async def start_handler(msg: Message, command: CommandObject):
45
+ # me: User = msg.from_user
46
+ # ref_id: int = command.args.isnumeric() and int(command.args)
47
+ # user = await models.User.get(username_id=me.id, blocked=False)
48
+ # rm = None
49
+ # logging.info(msg, {"src": "start"})
50
+ # if user:
51
+ # rs, rm = f"{me.full_name}, you have registered already😉", home_btns
52
+ # elif not (ref := await models.User.get_or_none(id=ref_id)):
53
+ # rs = f"No registered user #{ref_id}😬"
54
+ # else: # new user created
55
+ # user, cr = await models.User.tg2in(me, False)
56
+ # await user.update_from_dict({"ref": ref}).save()
57
+ # approve_btns = InlineKeyboardMarkup(
58
+ # inline_keyboard=[
59
+ # [
60
+ # InlineKeyboardButton(text="Отклонить", callback_data=RrCallbackData(to=user.id, res=False).pack()),
61
+ # InlineKeyboardButton(text="Одобрить", callback_data=RrCallbackData(to=user.id, res=True).pack()),
62
+ # ]
63
+ # ]
64
+ # )
65
+ # await msg.bot.send_message(
66
+ # ref.id, f"{me.full_name} просит что б Вы взяли за него/ее ответственность", reply_markup=approve_btns
67
+ # )
68
+ # return await msg.answer(f"Please wait for @{ref.username} approving...")
69
+ # return await msg.answer(rs, reply_markup=rm)
67
70
 
68
71
 
69
72
  @mr.message(CommandStart(deep_link=True)) # attempt to reg by fake link
70
- async def fraud_handler(msg: Message):
73
+ async def arg_handler(msg: Message, command: CommandObject):
71
74
  logging.warning(f"Start: {msg.from_user.id}. Msg: {msg}")
72
- # todo: alert to admins! Fraud attempt!
73
- await msg.answer("🤔")
75
+ arg: dict[str, int | str] = {"id": int(command.args)} if command.args.isnumeric() else {"username": command.args}
76
+ if ref := await models.Username.get_or_none(**arg):
77
+ txt = f"Вас пригласил {ref.username and '@'+ref.username or ref.id}, бонус: комиссия 0% на первые $100 000"
78
+ await msg.answer(txt, reply_markup=rm, parse_mode="Markdown")
74
79
 
75
80
 
76
81
  @mr.message(CommandStart()) # обычный /start
77
- async def home(msg: Message, store: Store):
82
+ async def home(msg: Message):
78
83
  me = msg.from_user
79
- user, is_new = await models.User.tg_upsert(me, False)
80
-
81
- rr = "сначала вы должны найти поручителя, и перейти по его реферальной ссылке.\nhttps://telegra.ph/XyncNet-02-13"
82
- if is_new: # has ref and created now
83
- await msg.answer(f"Здравствуйте {me.full_name}, что бы использовать возможности нашей сети, {rr}")
84
- elif not user.ref_id:
85
- await msg.answer(rr.capitalize())
86
- else:
87
- await msg.answer(f"{me.full_name}, не балуйтесь, вы и так уже активный участник👌🏼", reply_markup=home_btns)
84
+ await models.User.tg_upsert(me, False)
85
+ await msg.answer(txt, reply_markup=rm, parse_mode="Markdown")
88
86
 
89
87
 
90
88
  @mr.callback_query(RrCallbackData.filter())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-bot
3
- Version: 0.3.26
3
+ Version: 0.3.27
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes