randydev commited on
Commit
b3f3c58
·
verified ·
1 Parent(s): 8252e98
akn/AllDownloaderBot/blacklistchat.py CHANGED
@@ -25,7 +25,7 @@ async def welcomecheck(client, message: Message):
25
  )
26
  async def blacklist_user(c, m):
27
  is_sudo = await db.get_alldlbot_sudouser(c.me.id, m.from_user.id)
28
- protect_own = await db.get_alldlbot_by_user_id(m.from_user.id)
29
  if not protect_own and not is_sudo:
30
  return await m.reply_text("You are not allowed here.")
31
 
@@ -58,7 +58,7 @@ async def blacklist_user(c, m):
58
  )
59
  async def unblacklist_user(c, m):
60
  is_sudo = await db.get_alldlbot_sudouser(c.me.id, m.from_user.id)
61
- protect_own = await db.get_alldlbot_by_user_id(m.from_user.id)
62
  if not protect_own and not is_sudo:
63
  return await m.reply_text("You are not allowed here.")
64
 
@@ -93,9 +93,10 @@ async def add_sudo_func(client, message: Message):
93
  if message.chat.type.value != "supergroup":
94
  return await message.reply_text("This command can only be used in supergroups.")
95
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
96
- protect_own = await db.get_alldlbot_by_user_id(message.from_user.id)
97
  if not protect_own and not is_sudo:
98
  return await message.reply_text("You are not allowed here.")
 
99
  if len(message.command) != 2:
100
  return await message.reply_text("**Usage:**\n/addsudo [USER_ID]")
101
  user_id = int(message.text.strip().split()[1])
@@ -118,9 +119,10 @@ async def delc_sudo_func(client, message: Message):
118
  if message.chat.type.value != "supergroup":
119
  return await message.reply_text("This command can only be used in supergroups.")
120
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
121
- protect_own = await db.get_alldlbot_by_user_id(message.from_user.id)
122
  if not protect_own and not is_sudo:
123
  return await message.reply_text("You are not allowed here.")
 
124
  if len(message.command) != 2:
125
  return await message.reply_text("**Usage:**\n/delsudo [USER_ID]")
126
  user_id = int(message.text.strip().split()[1])
@@ -143,9 +145,10 @@ async def blacklist_chat_func(client, message: Message):
143
  if message.chat.type.value != "supergroup":
144
  return await message.reply_text("This command can only be used in supergroups.")
145
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
146
- protect_own = await db.get_alldlbot_by_user_id(message.from_user.id)
147
  if not protect_own and not is_sudo:
148
  return await message.reply_text("You are not allowed here.")
 
149
  if len(message.command) != 2:
150
  return await message.reply_text("**Usage:**\n/blacklistchat [CHAT_ID]")
151
  chat_id = int(message.text.strip().split()[1])
@@ -170,7 +173,7 @@ async def white_funciton(client, message: Message):
170
  if message.chat.type.value != "supergroup":
171
  return await message.reply_text("This command can only be used in supergroups.")
172
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
173
- protect_own = await db.get_alldlbot_by_user_id(message.from_user.id)
174
  if not protect_own and not is_sudo:
175
  return await message.reply_text("You are not allowed here.")
176
  if len(message.command) != 2:
@@ -192,7 +195,7 @@ async def all_chats(client, message: Message):
192
  if message.chat.type.value != "supergroup":
193
  return await message.reply_text("This command can only be used in supergroups.")
194
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
195
- protect_own = await db.get_alldlbot_by_user_id(message.from_user.id)
196
  if not protect_own and not is_sudo:
197
  return await message.reply_text("You are not allowed here.")
198
  text = "**Blacklisted Chats:**\n\n"
@@ -218,7 +221,7 @@ async def list_sudo_func(client, message: Message):
218
  if message.chat.type.value != "supergroup":
219
  return await message.reply_text("This command can only be used in supergroups.")
220
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
221
- protect_own = await db.get_alldlbot_by_user_id(message.from_user.id)
222
  if not protect_own and not is_sudo:
223
  return await message.reply_text("You are not allowed here.")
224
  text = "**List SudoUser:**\n\n"
@@ -244,7 +247,7 @@ async def view_blacklist_user_func(client, message: Message):
244
  if message.chat.type.value != "supergroup":
245
  return await message.reply_text("This command can only be used in supergroups.")
246
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
247
- protect_own = await db.get_alldlbot_by_user_id(message.from_user.id)
248
  if not protect_own and not is_sudo:
249
  return await message.reply_text("You are not allowed here.")
250
  text = "**Blacklisted Users:**\n\n"
 
25
  )
26
  async def blacklist_user(c, m):
27
  is_sudo = await db.get_alldlbot_sudouser(c.me.id, m.from_user.id)
28
+ protect_own = await db.get_alldlbot_by_user_id(m.from_user.id, c.me.id)
29
  if not protect_own and not is_sudo:
30
  return await m.reply_text("You are not allowed here.")
31
 
 
58
  )
59
  async def unblacklist_user(c, m):
60
  is_sudo = await db.get_alldlbot_sudouser(c.me.id, m.from_user.id)
61
+ protect_own = await db.get_alldlbot_by_user_id(m.from_user.id, c.me.id)
62
  if not protect_own and not is_sudo:
63
  return await m.reply_text("You are not allowed here.")
64
 
 
93
  if message.chat.type.value != "supergroup":
94
  return await message.reply_text("This command can only be used in supergroups.")
95
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
96
+ protect_own = await db.get_alldlbot_by_user_id(message.from_user.id, client.me.id)
97
  if not protect_own and not is_sudo:
98
  return await message.reply_text("You are not allowed here.")
99
+
100
  if len(message.command) != 2:
101
  return await message.reply_text("**Usage:**\n/addsudo [USER_ID]")
102
  user_id = int(message.text.strip().split()[1])
 
119
  if message.chat.type.value != "supergroup":
120
  return await message.reply_text("This command can only be used in supergroups.")
121
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
122
+ protect_own = await db.get_alldlbot_by_user_id(message.from_user.id, client.me.id)
123
  if not protect_own and not is_sudo:
124
  return await message.reply_text("You are not allowed here.")
125
+
126
  if len(message.command) != 2:
127
  return await message.reply_text("**Usage:**\n/delsudo [USER_ID]")
128
  user_id = int(message.text.strip().split()[1])
 
145
  if message.chat.type.value != "supergroup":
146
  return await message.reply_text("This command can only be used in supergroups.")
147
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
148
+ protect_own = await db.get_alldlbot_by_user_id(message.from_user.id, client.me.id)
149
  if not protect_own and not is_sudo:
150
  return await message.reply_text("You are not allowed here.")
151
+
152
  if len(message.command) != 2:
153
  return await message.reply_text("**Usage:**\n/blacklistchat [CHAT_ID]")
154
  chat_id = int(message.text.strip().split()[1])
 
173
  if message.chat.type.value != "supergroup":
174
  return await message.reply_text("This command can only be used in supergroups.")
175
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
176
+ protect_own = await db.get_alldlbot_by_user_id(message.from_user.id, client.me.id)
177
  if not protect_own and not is_sudo:
178
  return await message.reply_text("You are not allowed here.")
179
  if len(message.command) != 2:
 
195
  if message.chat.type.value != "supergroup":
196
  return await message.reply_text("This command can only be used in supergroups.")
197
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
198
+ protect_own = await db.get_alldlbot_by_user_id(message.from_user.id, client.me.id)
199
  if not protect_own and not is_sudo:
200
  return await message.reply_text("You are not allowed here.")
201
  text = "**Blacklisted Chats:**\n\n"
 
221
  if message.chat.type.value != "supergroup":
222
  return await message.reply_text("This command can only be used in supergroups.")
223
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
224
+ protect_own = await db.get_alldlbot_by_user_id(message.from_user.id, client.me.id)
225
  if not protect_own and not is_sudo:
226
  return await message.reply_text("You are not allowed here.")
227
  text = "**List SudoUser:**\n\n"
 
247
  if message.chat.type.value != "supergroup":
248
  return await message.reply_text("This command can only be used in supergroups.")
249
  is_sudo = await db.get_alldlbot_sudouser(client.me.id, message.from_user.id)
250
+ protect_own = await db.get_alldlbot_by_user_id(message.from_user.id, client.me.id)
251
  if not protect_own and not is_sudo:
252
  return await message.reply_text("You are not allowed here.")
253
  text = "**Blacklisted Users:**\n\n"