sticker-captcha-bot/plugins/service.py

29 lines
783 B
Python
Raw Normal View History

2023-10-18 15:50:27 +00:00
from pyrogram import filters
from sticker import bot
2024-11-11 08:57:10 +00:00
from sticker.functions.service_message import ServiceMessage
2023-10-18 15:50:27 +00:00
from sticker.single_utils import Client, Message
2024-11-17 13:14:22 +00:00
@bot.on_message(filters.new_chat_members, group=2)
2023-10-18 15:50:27 +00:00
async def service_message_handle(_: Client, message: Message):
cid = message.chat.id
if message.new_chat_members:
for i in message.new_chat_members:
if i.is_self:
return
user = (
message.new_chat_members[0] if message.new_chat_members else message.from_user
)
if (
user.is_self
or user.is_verified
or user.is_bot
or user.is_deleted
or user.is_support
):
return
uid = user.id
mid = message.id
await ServiceMessage.set_cache(uid, cid, mid)