randydev commited on
Commit
8252e98
Β·
verified Β·
1 Parent(s): 0a2bc0c
Files changed (1) hide show
  1. akn/manage/builderclone_bots.py +5 -2
akn/manage/builderclone_bots.py CHANGED
@@ -57,6 +57,7 @@ async def new_alldlbot_clone(bot: Client, cb: CallbackQuery):
57
 
58
  existing_request = await db_client.alldl_bot.find_one({"user_id": user_id})
59
 
 
60
  token_exists = await db_client.alldl_bot.find_one(
61
  {"bots.bot_token": bot_token}
62
  )
@@ -68,7 +69,7 @@ async def new_alldlbot_clone(bot: Client, cb: CallbackQuery):
68
  reply_markup=InlineKeyboardMarkup([
69
  [InlineKeyboardButton("πŸ†• Create New Bot", url="https://t.me/BotFather")],
70
  [InlineKeyboardButton("πŸ”„ Try Again", callback_data="alldl_bot")],
71
- [InlineKeyboardButton("πŸ“Š Manage Bots", callback_data="my_bots")]
72
  ])
73
  )
74
  return
@@ -103,6 +104,7 @@ async def new_alldlbot_clone(bot: Client, cb: CallbackQuery):
103
  "uuid": bot_uuid,
104
  "user_id": user_id,
105
  "bot_token": bot_token,
 
106
  "status": "pending",
107
  "is_active": False,
108
  "timestamp": current_time
@@ -112,13 +114,14 @@ async def new_alldlbot_clone(bot: Client, cb: CallbackQuery):
112
  await db_client.alldl_bot.update_one(
113
  {"user_id": user_id},
114
  {"$push": {"bots": bot_data},
115
- "$set": {"last_updated": current_time}},
116
  upsert=True
117
  )
118
  approved_count = sum(1 for bot in existing_request.get("bots", []) if bot.get("status") == "approved")
119
  else:
120
  await db_client.alldl_bot.insert_one({
121
  "user_id": user_id,
 
122
  "username": cb.from_user.username,
123
  "bots": [bot_data],
124
  "deployed_bots": 0,
 
57
 
58
  existing_request = await db_client.alldl_bot.find_one({"user_id": user_id})
59
 
60
+ replace_bot_id = bot_token.split(":")[0]
61
  token_exists = await db_client.alldl_bot.find_one(
62
  {"bots.bot_token": bot_token}
63
  )
 
69
  reply_markup=InlineKeyboardMarkup([
70
  [InlineKeyboardButton("πŸ†• Create New Bot", url="https://t.me/BotFather")],
71
  [InlineKeyboardButton("πŸ”„ Try Again", callback_data="alldl_bot")],
72
+ [InlineKeyboardButton("❌ Cancel", callback_data="customzie_bot")]
73
  ])
74
  )
75
  return
 
104
  "uuid": bot_uuid,
105
  "user_id": user_id,
106
  "bot_token": bot_token,
107
+ "bot_id": replace_bot_id,
108
  "status": "pending",
109
  "is_active": False,
110
  "timestamp": current_time
 
114
  await db_client.alldl_bot.update_one(
115
  {"user_id": user_id},
116
  {"$push": {"bots": bot_data},
117
+ "$set": {"last_updated": current_time, "bot_id": replace_bot_id}},
118
  upsert=True
119
  )
120
  approved_count = sum(1 for bot in existing_request.get("bots", []) if bot.get("status") == "approved")
121
  else:
122
  await db_client.alldl_bot.insert_one({
123
  "user_id": user_id,
124
+ "bot_id": replace_bot_id,
125
  "username": cb.from_user.username,
126
  "bots": [bot_data],
127
  "deployed_bots": 0,