xync-bot 0.3.24.dev5__tar.gz → 0.3.24.dev6__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.24.dev5/xync_bot.egg-info → xync_bot-0.3.24.dev6}/PKG-INFO +1 -1
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/pay/dep.py +7 -3
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/pay/handler.py +5 -16
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/pay/window.py +1 -1
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6/xync_bot.egg-info}/PKG-INFO +1 -1
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/.env.dist +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/.gitignore +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/.pre-commit-config.yaml +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/makefile +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/pyproject.toml +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/setup.cfg +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/test_main.http +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/__init__.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/loader.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/__init__.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/cond/__init__.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/cond/func.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/main.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/order.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/pay/cd.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/photo.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/vpn.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/routers/xicon.png +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/shared.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot/typs.py +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot.egg-info/SOURCES.txt +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot.egg-info/dependency_links.txt +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot.egg-info/requires.txt +0 -0
- {xync_bot-0.3.24.dev5 → xync_bot-0.3.24.dev6}/xync_bot.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from asyncio import gather
|
|
2
2
|
from enum import IntEnum
|
|
3
3
|
|
|
4
|
+
from aiogram.exceptions import TelegramBadRequest
|
|
4
5
|
from aiogram.fsm.state import StatesGroup, State
|
|
5
6
|
from aiogram.types import Message, InlineKeyboardMarkup
|
|
6
7
|
from pyrogram.types import CallbackQuery
|
|
@@ -110,6 +111,9 @@ async def edt(msg: Message, txt: str, rm: InlineKeyboardMarkup):
|
|
|
110
111
|
if msg.message_id == msg.bot.store.perm.msg_id:
|
|
111
112
|
await msg.edit_text(txt, reply_markup=rm)
|
|
112
113
|
else: # окно вызвано в ответ на текст, а не кнопку
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
try:
|
|
115
|
+
await msg.bot.edit_message_text(
|
|
116
|
+
txt, chat_id=msg.chat.id, message_id=msg.bot.store.perm.msg_id, reply_markup=rm
|
|
117
|
+
)
|
|
118
|
+
except TelegramBadRequest as e:
|
|
119
|
+
print(msg.bot.store.perm.msg_id, e)
|
|
@@ -125,18 +125,18 @@ async def h_got_amount(msg: Message, state: FSMContext):
|
|
|
125
125
|
|
|
126
126
|
@pay.callback_query(cd.Pm.filter(F.is_target.__eq__(0)))
|
|
127
127
|
async def h_got_source_pm(query: CallbackQuery, callback_data: cd.Pm):
|
|
128
|
-
query.message.bot.store
|
|
128
|
+
store: Store = query.message.bot.store
|
|
129
|
+
store.pay.s_pmcur_id = callback_data.pmcur_id
|
|
129
130
|
await gather(
|
|
130
131
|
window.set_ppo(query.message),
|
|
131
|
-
query.
|
|
132
|
-
ans(query, callback_data.name),
|
|
132
|
+
ans(query, store.glob.pms[callback_data.pmcur_id]),
|
|
133
133
|
)
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
@pay.callback_query(cd.Ppo.filter())
|
|
137
137
|
async def h_got_ppo(query: CallbackQuery, callback_data: cd.Ppo):
|
|
138
138
|
query.message.bot.store.pay.ppo = callback_data.num
|
|
139
|
-
await gather(window.set_urgency(query.message),
|
|
139
|
+
await gather(window.set_urgency(query.message), ans(query, str(callback_data.num)))
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
@pay.callback_query(cd.Time.filter())
|
|
@@ -190,7 +190,6 @@ async def payment_confirmed(query: CallbackQuery, state: FSMContext):
|
|
|
190
190
|
builder = InlineKeyboardBuilder()
|
|
191
191
|
builder.button(text="Новый платеж💸", callback_data=cd.PayNav(to=cd.PayStep.t_type))
|
|
192
192
|
await query.message.answer("✅ Платеж успешно подтвержден", reply_markup=builder.as_markup())
|
|
193
|
-
await query.message.delete()
|
|
194
193
|
await state.clear()
|
|
195
194
|
|
|
196
195
|
|
|
@@ -214,20 +213,18 @@ async def payment_not_specified(msg: Message, state: FSMContext):
|
|
|
214
213
|
f"Детали платежа: {data["text"]}\n"
|
|
215
214
|
f"Время: {msg.date.strftime('%Y-%m-%d %H:%M:%S')}"
|
|
216
215
|
)
|
|
217
|
-
await msg.bot.send_message(chat_id="
|
|
216
|
+
await msg.bot.send_message(chat_id="xyncpay", text=complaint_text)
|
|
218
217
|
|
|
219
218
|
|
|
220
219
|
# NAVIGATION
|
|
221
220
|
@pay.callback_query(cd.PayNav.filter(F.to.in_([cd.PayStep.t_type, cd.PayStep.s_type])))
|
|
222
221
|
async def handle_home(query: CallbackQuery, state: FSMContext):
|
|
223
|
-
await query.message.delete()
|
|
224
222
|
await ans(query, None)
|
|
225
223
|
await window.type_select(query.message, await state.get_value("is_target"))
|
|
226
224
|
|
|
227
225
|
|
|
228
226
|
@pay.callback_query(cd.PayNav.filter(F.to.in_([cd.PayStep.t_coin, cd.PayStep.s_coin])))
|
|
229
227
|
async def to_coin_select(query: CallbackQuery, state: FSMContext):
|
|
230
|
-
await query.message.delete()
|
|
231
228
|
await ans(query, None)
|
|
232
229
|
is_target = await state.get_value("is_target")
|
|
233
230
|
pref = "t" if is_target else "s"
|
|
@@ -237,7 +234,6 @@ async def to_coin_select(query: CallbackQuery, state: FSMContext):
|
|
|
237
234
|
|
|
238
235
|
@pay.callback_query(cd.PayNav.filter(F.to.in_([cd.PayStep.t_cur, cd.PayStep.s_cur])))
|
|
239
236
|
async def to_cur_select(query: CallbackQuery, state: FSMContext):
|
|
240
|
-
await query.message.delete()
|
|
241
237
|
await ans(query, None)
|
|
242
238
|
is_target = await state.get_value("is_target")
|
|
243
239
|
pref = "t" if is_target else "s"
|
|
@@ -247,7 +243,6 @@ async def to_cur_select(query: CallbackQuery, state: FSMContext):
|
|
|
247
243
|
|
|
248
244
|
@pay.callback_query(cd.PayNav.filter(F.to.in_([cd.PayStep.t_pm, cd.PayStep.s_pm])))
|
|
249
245
|
async def to_pm_select(query: CallbackQuery, state: FSMContext):
|
|
250
|
-
await query.message.delete()
|
|
251
246
|
await ans(query, None)
|
|
252
247
|
await window.pm(query.message)
|
|
253
248
|
|
|
@@ -257,21 +252,17 @@ async def back_to_cred_detail(query: CallbackQuery, state: FSMContext):
|
|
|
257
252
|
await ans(query, None)
|
|
258
253
|
await state.update_data(detail=None)
|
|
259
254
|
await window.fill_cred_dtl(query.message)
|
|
260
|
-
await query.message.delete()
|
|
261
255
|
|
|
262
256
|
|
|
263
257
|
@pay.callback_query(cd.PayNav.filter(F.to.__eq__(cd.PayStep.t_cred_name)))
|
|
264
258
|
async def back_to_cred_name(query: CallbackQuery, state: FSMContext):
|
|
265
|
-
await query.message.delete()
|
|
266
259
|
await ans(query, None)
|
|
267
260
|
await state.update_data(name=None)
|
|
268
261
|
await window.fill_cred_name(query.message)
|
|
269
|
-
await query.message.delete()
|
|
270
262
|
|
|
271
263
|
|
|
272
264
|
@pay.callback_query(cd.PayNav.filter(F.to.in_([cd.PayStep.t_ex, cd.PayStep.s_ex])))
|
|
273
265
|
async def back_to_ex_select(query: CallbackQuery, state: FSMContext):
|
|
274
|
-
await query.message.delete()
|
|
275
266
|
await ans(query, None)
|
|
276
267
|
await state.update_data({("t" if await state.get_value("is_target") else "s") + "ex_id": None})
|
|
277
268
|
await window.ex_select(query.message)
|
|
@@ -279,7 +270,6 @@ async def back_to_ex_select(query: CallbackQuery, state: FSMContext):
|
|
|
279
270
|
|
|
280
271
|
@pay.callback_query(cd.PayNav.filter(F.to.__eq__(cd.PayStep.t_amount)))
|
|
281
272
|
async def back_to_amount(query: CallbackQuery, state: FSMContext):
|
|
282
|
-
await query.message.delete()
|
|
283
273
|
await ans(query, None)
|
|
284
274
|
await state.update_data(amount=None)
|
|
285
275
|
await window.amount(query.message)
|
|
@@ -287,7 +277,6 @@ async def back_to_amount(query: CallbackQuery, state: FSMContext):
|
|
|
287
277
|
|
|
288
278
|
@pay.callback_query(cd.PayNav.filter(F.to.in_([cd.PayStep.t_pm])))
|
|
289
279
|
async def back_to_payment(query: CallbackQuery, state: FSMContext):
|
|
290
|
-
await query.message.delete()
|
|
291
280
|
await ans(query, None)
|
|
292
281
|
await state.update_data(payment=None)
|
|
293
282
|
await window.pm(query.message)
|
|
@@ -142,7 +142,7 @@ async def amount(msg: Message):
|
|
|
142
142
|
builder.button(text="Домой", callback_data=cd.PayNav(to=cd.PayStep.t_type))
|
|
143
143
|
builder.adjust(2)
|
|
144
144
|
|
|
145
|
-
await msg
|
|
145
|
+
await edt(msg, f"Введите нужную сумму {cur_coin} для {t_name}", builder.as_markup())
|
|
146
146
|
|
|
147
147
|
|
|
148
148
|
async def set_ppo(msg: Message):
|
|
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
|