-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.py
More file actions
25 lines (20 loc) · 849 Bytes
/
users.py
File metadata and controls
25 lines (20 loc) · 849 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
from telegram.ext import ContextTypes, Application
print("users.py has been imported")
# کانالهایی که باید عضو شوند
required_channels = ["@sepydev"]
# بررسی عضویت کاربر در کانالها
async def is_user_in_channels(user_id, context: ContextTypes.DEFAULT_TYPE):
for channel in required_channels:
try:
member = await context.bot.get_chat_member(chat_id=channel, user_id=user_id)
if member.status not in ["member", "administrator", "creator"]:
print("1")
return False
except:
print("2")
return False
print("3")
return True
def start_user_management(application: Application):
# کد مربوط به مدیریت کاربران را اینجا اضافه کنید
pass