randydev commited on
Commit
34af195
·
verified ·
1 Parent(s): 8d06de0

Updated all

Browse files
Files changed (1) hide show
  1. akn/AllDownloaderBot/admins.py +13 -2
akn/AllDownloaderBot/admins.py CHANGED
@@ -71,6 +71,11 @@ async def xarzunmute_cbok(client, callback):
71
  return
72
  user_mention = callback.from_user.mention
73
  await client.restrict_chat_member(chat_id, user_id, unmute_permissions)
 
 
 
 
 
74
  await callback.message.edit_text(
75
  f"✅ User {user_id} unmuted by {user_mention}",
76
  reply_markup=None
@@ -228,6 +233,9 @@ async def arz_ban_user(client: Client, message: Message):
228
  )
229
  async def arz_unban_user(client: Client, message: Message):
230
  user_id, reason = await extract_user_and_reason(message, sender_chat=True)
 
 
 
231
  if not user_id:
232
  return await message.reply_text("I can't find that user.")
233
  if user_id == client.me.id:
@@ -351,6 +359,9 @@ async def arz_mute(client: Client, message: Message):
351
  )
352
  async def arz_unmute(client: Client, message: Message):
353
  user_id, reason = await extract_user_and_reason(message, sender_chat=True)
 
 
 
354
  if not user_id:
355
  return await message.reply_text("I can't find that user.")
356
  if user_id == client.me.id:
@@ -376,7 +387,7 @@ async def arz_unmute(client: Client, message: Message):
376
  await db.alldl_bot.update_one(
377
  {"bot_id": client.me.id},
378
  {"$pull": {"mute_user": user_id}},
379
- upsert=True,
380
  )
381
  await message.reply_text(msg)
382
 
@@ -387,7 +398,7 @@ async def arz_unmute(client: Client, message: Message):
387
  )
388
  async def arz_mute_all(client: Client, message: Message):
389
  bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
390
- if not bot.can_restrict_members:
391
  return await message.reply_text("I don't have enough permissions")
392
  if message.chat.type == ChatType.PRIVATE:
393
  return await message.reply_text("This command is not available in private chats.")
 
71
  return
72
  user_mention = callback.from_user.mention
73
  await client.restrict_chat_member(chat_id, user_id, unmute_permissions)
74
+ await db.alldl_bot.update_one(
75
+ {"bot_id": client.me.id},
76
+ {"$pull": {"mute_user": user_id}},
77
+ upsert=True
78
+ )
79
  await callback.message.edit_text(
80
  f"✅ User {user_id} unmuted by {user_mention}",
81
  reply_markup=None
 
233
  )
234
  async def arz_unban_user(client: Client, message: Message):
235
  user_id, reason = await extract_user_and_reason(message, sender_chat=True)
236
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
237
+ if not bot or not bot.can_restrict_members:
238
+ return await message.reply_text("I don't have enough permissions")
239
  if not user_id:
240
  return await message.reply_text("I can't find that user.")
241
  if user_id == client.me.id:
 
359
  )
360
  async def arz_unmute(client: Client, message: Message):
361
  user_id, reason = await extract_user_and_reason(message, sender_chat=True)
362
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
363
+ if not bot or not bot.can_restrict_members:
364
+ return await message.reply_text("I don't have enough permissions")
365
  if not user_id:
366
  return await message.reply_text("I can't find that user.")
367
  if user_id == client.me.id:
 
387
  await db.alldl_bot.update_one(
388
  {"bot_id": client.me.id},
389
  {"$pull": {"mute_user": user_id}},
390
+ upsert=True
391
  )
392
  await message.reply_text(msg)
393
 
 
398
  )
399
  async def arz_mute_all(client: Client, message: Message):
400
  bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
401
+ if not bot or not bot.can_restrict_members:
402
  return await message.reply_text("I don't have enough permissions")
403
  if message.chat.type == ChatType.PRIVATE:
404
  return await message.reply_text("This command is not available in private chats.")