-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathignore.py
More file actions
30 lines (25 loc) · 958 Bytes
/
ignore.py
File metadata and controls
30 lines (25 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from pyrogram import Client, filters
from command import fox_command, fox_sudo, who_message
import os
i = filters.user([])
@Client.on_message(i & ~filters.me)
async def ignored(client, message):
await message.delete()
@Client.on_message(fox_command("ignore", "IgnoreUser", os.path.basename(__file__), "[user_id/@username]") & fox_sudo())
async def add_ignore(client, message):
message = await who_message(client, message)
try:
try:
users = int(message.command[1])
except:
users = str(message.command[1]).replace("@", "")
users = int((await client.get_users(str(users))).id)
except:
users = message.reply_to_message.from_user.id
print(users)
if users in i:
i.remove(int(users))
await message.edit(f"`{str(users)}` no longer ignored")
else:
i.add(int(users))
await message.edit(f"`{str(users)}` ignored")