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.
- {xync_bot-0.3.26/xync_bot.egg-info → xync_bot-0.3.27}/PKG-INFO +1 -1
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/main/handler.py +39 -41
- {xync_bot-0.3.26 → xync_bot-0.3.27/xync_bot.egg-info}/PKG-INFO +1 -1
- {xync_bot-0.3.26 → xync_bot-0.3.27}/.env.dist +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/.gitignore +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/.pre-commit-config.yaml +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/makefile +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/pager.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/pyproject.toml +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/setup.cfg +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/test_main.http +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/__main__.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/loader.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/__init__.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/cond/__init__.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/cond/func.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/main/__init__.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/order.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/pay/cd.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/pay/dep.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/pay/handler.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/pay/window.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/photo.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/send/__init__.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/vpn.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/routers/xicon.png +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/shared.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/store.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot/typs.py +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot.egg-info/SOURCES.txt +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot.egg-info/dependency_links.txt +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot.egg-info/requires.txt +0 -0
- {xync_bot-0.3.26 → xync_bot-0.3.27}/xync_bot.egg-info/top_level.txt +0 -0
|
@@ -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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
|
73
|
+
async def arg_handler(msg: Message, command: CommandObject):
|
|
71
74
|
logging.warning(f"Start: {msg.from_user.id}. Msg: {msg}")
|
|
72
|
-
|
|
73
|
-
await
|
|
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
|
|
82
|
+
async def home(msg: Message):
|
|
78
83
|
me = msg.from_user
|
|
79
|
-
|
|
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())
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|