add no_prefix filter freate fcn

This commit is contained in:
Abhi
2024-12-08 07:13:19 +05:30
parent b7963023e5
commit b2b7271654

View File

@@ -30,7 +30,7 @@ from types import ModuleType
from typing import Dict, Tuple
import psutil
from pyrogram import Client, errors, enums
from pyrogram import Client, errors, enums, filters
from pyrogram.errors import FloodWait, MessageNotModified, UserNotParticipant
from pyrogram.types import Message
from pyrogram.enums import ChatMembersFilter
@@ -515,6 +515,15 @@ async def unload_module(module_name: str, client: Client) -> bool:
return True
def no_prefix(handler):
def func(_, __, message):
if message.text and not message.text.startswith(handler):
return True
return False
return filters.create(func)
def parse_meta_comments(code: str) -> Dict[str, str]:
try:
groups = META_COMMENTS.search(code).groups()