Spaces:
Paused
Paused
Jishu Developer
commited on
Update helper_func.py
Browse files- helper_func.py +1 -15
helper_func.py
CHANGED
|
@@ -29,21 +29,7 @@ async def is_subscribed(filter, client, update):
|
|
| 29 |
if not member.status in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.MEMBER]:
|
| 30 |
return False
|
| 31 |
else:
|
| 32 |
-
return True
|
| 33 |
-
|
| 34 |
-
async def is_subscribed(filter, client, update):
|
| 35 |
-
if not FORCE_SUB_CHANNEL:
|
| 36 |
-
return True
|
| 37 |
-
user_id = update.from_user.id
|
| 38 |
-
if user_id in ADMINS:
|
| 39 |
-
return True
|
| 40 |
-
try:
|
| 41 |
-
member = await client.get_chat_member(chat_id = FORCE_SUB_CHANNEL, user_id = user_id)
|
| 42 |
-
except UserNotParticipant:
|
| 43 |
-
return False
|
| 44 |
-
|
| 45 |
-
if not member.status in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.MEMBER]:
|
| 46 |
-
return False
|
| 47 |
|
| 48 |
async def encode(string):
|
| 49 |
string_bytes = string.encode("ascii")
|
|
|
|
| 29 |
if not member.status in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.MEMBER]:
|
| 30 |
return False
|
| 31 |
else:
|
| 32 |
+
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
async def encode(string):
|
| 35 |
string_bytes = string.encode("ascii")
|