update
Browse files- akn/manage/bots_manage.py +36 -1
akn/manage/bots_manage.py
CHANGED
@@ -63,7 +63,9 @@ async def userbotdashboardub(client: Client, callback: CallbackQuery):
|
|
63 |
buttons.append(
|
64 |
[InlineKeyboardButton("βοΈ Settings", callback_data="ubsetting")]
|
65 |
)
|
66 |
-
|
|
|
|
|
67 |
await callback.message.edit_text(
|
68 |
text,
|
69 |
reply_markup=InlineKeyboardMarkup(buttons)
|
@@ -87,6 +89,39 @@ async def userbotsettingsub(client: Client, callback: CallbackQuery):
|
|
87 |
)
|
88 |
await callback.answer()
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
@ren.on_callback_query(filters.regex("^my_bots$"))
|
91 |
async def show_user_bots(client: Client, callback: CallbackQuery):
|
92 |
user_id = callback.from_user.id
|
|
|
63 |
buttons.append(
|
64 |
[InlineKeyboardButton("βοΈ Settings", callback_data="ubsetting")]
|
65 |
)
|
66 |
+
buttons.append(
|
67 |
+
[InlineKeyboardButton("π Back", callback_data="confirm_userbot")]
|
68 |
+
)
|
69 |
await callback.message.edit_text(
|
70 |
text,
|
71 |
reply_markup=InlineKeyboardMarkup(buttons)
|
|
|
89 |
)
|
90 |
await callback.answer()
|
91 |
|
92 |
+
@Client.on_callback_query(filters.regex("^(set_sessionub|update_sessionub)$"))
|
93 |
+
async def asksessionstringub(client: Client, callback: CallbackQuery):
|
94 |
+
await callback.message.edit_text(
|
95 |
+
"π **Session String Setup: @sessiondevbot**\n\n"
|
96 |
+
"Please send your session string in this format:\n\n"
|
97 |
+
"`ABCDEF1234ghIklzyx57W2v1u123ew11*********`\n\n"
|
98 |
+
"β οΈ This will replace your current session!\n\n"
|
99 |
+
"Cancelled use /cancel",
|
100 |
+
reply_markup=None
|
101 |
+
)
|
102 |
+
try:
|
103 |
+
string_msg = await client.listen(callback_query.message.chat.id, timeout=60)
|
104 |
+
if string_msg.text.lower() == "/cancel":
|
105 |
+
await string_msg.reply(
|
106 |
+
"β Cancelled.",
|
107 |
+
reply_markup=ikb([
|
108 |
+
[("Β« Back", "my_userbotub")]
|
109 |
+
])
|
110 |
+
)
|
111 |
+
return
|
112 |
+
|
113 |
+
string_update = string_msg.text.strip()
|
114 |
+
|
115 |
+
await db_client.session.update_one(
|
116 |
+
{"user_id": callback.from_user.id},
|
117 |
+
{"$set": {"user_client.$.session_string": string_update}}
|
118 |
+
)
|
119 |
+
await string_msg.reply("β
Session string updated successfully!")
|
120 |
+
except TimeoutError:
|
121 |
+
await callback.message.reply_text("β Session setup timed out")
|
122 |
+
except Exception as e:
|
123 |
+
await callback.message.reply_text(f"β Error: {str(e)}")
|
124 |
+
|
125 |
@ren.on_callback_query(filters.regex("^my_bots$"))
|
126 |
async def show_user_bots(client: Client, callback: CallbackQuery):
|
127 |
user_id = callback.from_user.id
|