حذف کردن یک کاربر خاص هنگام ورود به گروه

This commit is contained in:
2026-09-05 09:44:47 +03:30
parent 1aac5af086
commit c7639a251f
2 changed files with 12 additions and 1 deletions
+10 -1
View File
@@ -3,6 +3,7 @@ import logging
from bot import bot
from balethon.conditions import equals, regex
from config import IM
logger = logging.getLogger(__name__)
@@ -152,7 +153,15 @@ async def welcome(message):
if member.is_bot:
continue
try:
if member.id == IM:
await bot.ban_chat_member(
chat_id=message.chat.id,
user_id=member.id,
)
return
except Exception as e:
print(e)
await message.reply(
f"👋 سلام {member.first_name} عزیز\n"
f"به گروه {message.chat.title} خوش آمدید.\n"