This repository has been archived on 2024-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
EmojiCaptchaBot/plugins/handlers/bot_join.py

16 lines
477 B
Python

import logging
from pyrogram import filters
from pyrogram.types import Message
from classes.pyroclient import PyroClient
from classes.pyrogroup import PyroGroup
logger = logging.getLogger(__name__)
@PyroClient.on_message(filters.new_chat_members & filters.group & filters.me) # type: ignore
async def handler_bot_join(app: PyroClient, message: Message):
logger.info("Bot has joined the group %s")
await PyroGroup.create_if_not_exists(message.chat.id, None, True)