randydev commited on
Commit
f32ead8
·
1 Parent(s): f90d21b

fix update

Browse files
akn/AllDownloaderBot/admins.py CHANGED
@@ -292,7 +292,8 @@ async def arz_unmute(client: Client, message: Message):
292
  & ~filters.forwarded
293
  )
294
  async def arz_mute_all(client: Client, message: Message):
295
- if not message.chat.permissions.can_restrict_members:
 
296
  return await message.reply_text("I don't have enough permissions")
297
  if message.chat.type == ChatType.PRIVATE:
298
  return await message.reply_text("This command is not available in private chats.")
@@ -313,7 +314,8 @@ async def arz_mute_all(client: Client, message: Message):
313
  & ~filters.forwarded
314
  )
315
  async def arz_unmute_all(client: Client, message: Message):
316
- if not message.chat.permissions.can_restrict_members:
 
317
  return await message.reply_text("I don't have enough permissions")
318
  if message.chat.type == ChatType.PRIVATE:
319
  return await message.reply_text("This command is not available in private chats.")
@@ -335,7 +337,8 @@ async def arz_unmute_all(client: Client, message: Message):
335
  )
336
  async def arz_mute_me(client: Client, message: Message):
337
  user_id = message.from_user.id
338
- if not message.chat.permissions.can_restrict_members:
 
339
  return await message.reply_text("I don't have enough permissions")
340
  reason = None
341
  if not user_id:
@@ -385,7 +388,8 @@ async def arz_mute_me(client: Client, message: Message):
385
  async def arz_admin_list(client: Client, message: Message):
386
  if message.chat.type == ChatType.PRIVATE:
387
  return await message.reply_text("This command is not available in private chats.")
388
- if not message.chat.permissions.can_restrict_members:
 
389
  return await message.reply_text("I don't have enough permissions")
390
  try:
391
  async for m in client.get_chat_members(message.chat.id, filter=ChatMembersFilter.ADMINISTRATORS):
 
292
  & ~filters.forwarded
293
  )
294
  async def arz_mute_all(client: Client, message: Message):
295
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
296
+ if not bot.can_restrict_members:
297
  return await message.reply_text("I don't have enough permissions")
298
  if message.chat.type == ChatType.PRIVATE:
299
  return await message.reply_text("This command is not available in private chats.")
 
314
  & ~filters.forwarded
315
  )
316
  async def arz_unmute_all(client: Client, message: Message):
317
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
318
+ if not bot.can_restrict_members:
319
  return await message.reply_text("I don't have enough permissions")
320
  if message.chat.type == ChatType.PRIVATE:
321
  return await message.reply_text("This command is not available in private chats.")
 
337
  )
338
  async def arz_mute_me(client: Client, message: Message):
339
  user_id = message.from_user.id
340
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
341
+ if not bot.can_restrict_members:
342
  return await message.reply_text("I don't have enough permissions")
343
  reason = None
344
  if not user_id:
 
388
  async def arz_admin_list(client: Client, message: Message):
389
  if message.chat.type == ChatType.PRIVATE:
390
  return await message.reply_text("This command is not available in private chats.")
391
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
392
+ if not bot.can_restrict_members:
393
  return await message.reply_text("I don't have enough permissions")
394
  try:
395
  async for m in client.get_chat_members(message.chat.id, filter=ChatMembersFilter.ADMINISTRATORS):
akn/AllDownloaderBot/purge.py CHANGED
@@ -5,9 +5,9 @@ from akn.langs import transdev
5
 
6
  @Client.on_message(filters.command("setgpic"))
7
  async def arzsetgpic_command(client, message):
8
- if not message.chat.permissions.can_change_info:
9
- await message.reply("You don't have permission to change group info.")
10
- return
11
 
12
  if not message.reply_to_message:
13
  return await message.reply_text("Reply to a photo to set it as group picture.")
@@ -27,9 +27,9 @@ async def arzsetgpic_command(client, message):
27
 
28
  @Client.on_message(filters.command("setgname"))
29
  async def arzsetgname_command(client, message):
30
- if not message.chat.permissions.can_change_info:
31
- await message.reply("You don't have permission to change group info.")
32
- return
33
 
34
  if len(message.command) < 2:
35
  return await message.reply_text("Please provide a new group name.")
@@ -47,9 +47,9 @@ async def arzsetgname_command(client, message):
47
 
48
  @Client.on_message(filters.command("setgdesc"))
49
  async def arzsetgdesc_command(client, message):
50
- if not message.chat.permissions.can_change_info:
51
- await message.reply("You don't have permission to change group info.")
52
- return
53
 
54
  if len(message.command) < 2:
55
  return await message.reply_text("Please provide a new group description.")
@@ -68,6 +68,10 @@ async def arzsetgdesc_command(client, message):
68
 
69
  @Client.on_message(filters.command("purge"))
70
  async def arzpurge_command(client, message):
 
 
 
 
71
  if not message.reply_to_message:
72
  return await message.reply_text("Reply to message purge.")
73
  chat_id = message.chat.id
@@ -95,17 +99,4 @@ async def arzpurge_command(client, message):
95
  async def arzdel_user(_, message: Message):
96
  rep = message.reply_to_message
97
  await message.delete()
98
- await rep.delete()
99
-
100
- @Client.on_message(filters.command("delall"))
101
- async def arzdelall_command(client, message):
102
- if not message.chat.permissions.can_delete_messages:
103
- await message.reply("You don't have permission to delete messages.")
104
- return
105
-
106
- try:
107
- async for msg in client.get_chat_history(message.chat.id):
108
- await msg.delete()
109
- await message.delete()
110
- except Exception as e:
111
- await message.reply(f"Failed to delete messages: {e}")
 
5
 
6
  @Client.on_message(filters.command("setgpic"))
7
  async def arzsetgpic_command(client, message):
8
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
9
+ if not bot.can_change_info:
10
+ return await message.reply_text("I don't have enough permissions")
11
 
12
  if not message.reply_to_message:
13
  return await message.reply_text("Reply to a photo to set it as group picture.")
 
27
 
28
  @Client.on_message(filters.command("setgname"))
29
  async def arzsetgname_command(client, message):
30
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
31
+ if not bot.can_change_info:
32
+ return await message.reply_text("I don't have enough permissions")
33
 
34
  if len(message.command) < 2:
35
  return await message.reply_text("Please provide a new group name.")
 
47
 
48
  @Client.on_message(filters.command("setgdesc"))
49
  async def arzsetgdesc_command(client, message):
50
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
51
+ if not bot.can_change_info:
52
+ return await message.reply_text("I don't have enough permissions")
53
 
54
  if len(message.command) < 2:
55
  return await message.reply_text("Please provide a new group description.")
 
68
 
69
  @Client.on_message(filters.command("purge"))
70
  async def arzpurge_command(client, message):
71
+ bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
72
+ if not bot.can_delete_messages:
73
+ return await message.reply_text("I don't have enough permissions")
74
+
75
  if not message.reply_to_message:
76
  return await message.reply_text("Reply to message purge.")
77
  chat_id = message.chat.id
 
99
  async def arzdel_user(_, message: Message):
100
  rep = message.reply_to_message
101
  await message.delete()
102
+ await rep.delete()
 
 
 
 
 
 
 
 
 
 
 
 
 
akn/langs/id.yml CHANGED
@@ -39,9 +39,9 @@ messages:
39
 
40
  /del - Hapus pesan
41
  /purge - Hapus pesan
42
- /delall - Hapus semua pesan
43
  /setgpic - Atur foto grup
44
  /setgdesc - Atur description grup
 
45
 
46
  help_lock: |
47
  **Locking Commands:**
 
39
 
40
  /del - Hapus pesan
41
  /purge - Hapus pesan
 
42
  /setgpic - Atur foto grup
43
  /setgdesc - Atur description grup
44
+ /setgname - Atur nama grup
45
 
46
  help_lock: |
47
  **Locking Commands:**
akn/manage/callback.py CHANGED
@@ -60,7 +60,7 @@ Here’s what you can do with our bot:
60
  - **Gemini AI**: Explore cutting-edge AI capabilities.
61
  - **Session Pyrogram & Telethon**: Support Userbot with Pyrogram and Telethon
62
  - **Captcha Bot: Approved Captcha in Group Support
63
- - **All Downloader Bot**: everything support
64
 
65
  👇 **Get Started Now!**
66
  """
 
60
  - **Gemini AI**: Explore cutting-edge AI capabilities.
61
  - **Session Pyrogram & Telethon**: Support Userbot with Pyrogram and Telethon
62
  - **Captcha Bot: Approved Captcha in Group Support
63
+ - **Azrea Bot**: everything support
64
 
65
  👇 **Get Started Now!**
66
  """