Skip to content

Commit

Permalink
Merge pull request #4 from zaid5o5/main
Browse files Browse the repository at this point in the history
Handle left members
  • Loading branch information
RknDeveloper authored May 16, 2024
2 parents 885bd63 + a8101f8 commit 2afabc3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/Force_Sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def not_subscribed(_, client, message):
return False
try:
user = await client.get_chat_member(Config.FORCE_SUB, message.from_user.id)
if user.status == enums.ChatMemberStatus.BANNED:
if user.status in {enums.ChatMemberStatus.BANNED, enums.ChatMemberStatus.LEFT}:
return True
else:
return False
Expand All @@ -50,6 +50,8 @@ async def forces_sub(client, message):
user = await client.get_chat_member(Config.FORCE_SUB, message.from_user.id)
if user.status == enums.ChatMemberStatus.BANNED:
return await client.send_message(message.from_user.id, text="Sᴏʀʀy Yᴏᴜ'ʀᴇ Bᴀɴɴᴇᴅ Tᴏ Uꜱᴇ Mᴇ")
elif user.status == enums.ChatMemberStatus.LEFT:
return await message.reply_text(text=text, reply_markup=InlineKeyboardMarkup(buttons))
except UserNotParticipant:
return await message.reply_text(text=text, reply_markup=InlineKeyboardMarkup(buttons))
return await message.reply_text(text=text, reply_markup=InlineKeyboardMarkup(buttons))
Expand Down

0 comments on commit 2afabc3

Please sign in to comment.