This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Telegram/modules/handlers/voice.py

20 lines
615 B
Python
Raw Normal View History

from random import choice
from app import app
from pyrogram import filters
2022-12-27 14:36:54 +02:00
from pyrogram.types import Message
from pyrogram.client import Client
2022-12-18 18:54:58 +02:00
from modules.logging import logWrite
from modules.utils import configGet, locale
2023-01-03 21:34:13 +02:00
from modules import custom_filters
2023-03-09 17:25:06 +02:00
@app.on_message(
custom_filters.enabled_dinovoice
& ~filters.scheduled
& filters.voice
& filters.chat(configGet("users", "groups"))
)
2022-12-27 14:36:54 +02:00
async def voice_message(app: Client, msg: Message):
2022-12-18 18:54:58 +02:00
logWrite(f"User {msg.from_user.id} sent voice message in destination group")
2023-03-09 17:25:06 +02:00
await msg.reply_text(choice(locale("voice_message", "message")))