حذف کردن یک کاربر خاص هنگام ورود به گروه
This commit is contained in:
+10
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user