PagerMaid_Plugins_Pyro/voice_only_contact/main.py

15 lines
377 B
Python
Raw Permalink Normal View History

import contextlib
from pyrogram import filters
2024-09-28 14:35:08 +00:00
from pagermaid.enums import Message
from pagermaid.listener import raw_listener
@raw_listener(filters.private & filters.voice & filters.incoming)
async def voice_only_contact(message: Message):
with contextlib.suppress(Exception):
if message.from_user.is_contact:
return
await message.delete()