feat: add SST
This commit is contained in:
@@ -3,6 +3,8 @@ from pyrogram.types import Message
|
||||
from userbot import PyroClient
|
||||
from userbot.modules.capture import capture_message
|
||||
from userbot.modules.capture.chat_meta import meta_from_chat
|
||||
from userbot.modules.stt import is_transcribable
|
||||
from userbot.modules.stt.gate import safe_transcribe
|
||||
|
||||
|
||||
@PyroClient.on_message()
|
||||
@@ -15,6 +17,12 @@ async def on_message(client: PyroClient, message: Message) -> None:
|
||||
if not toggles.messages:
|
||||
return
|
||||
await capture_message(client, message, ctx, toggles)
|
||||
if (
|
||||
toggles.stt
|
||||
and is_transcribable(message)
|
||||
and (message.outgoing or message.unread_media is False)
|
||||
):
|
||||
await safe_transcribe(client, ctx, meta.chat_id, message.id)
|
||||
|
||||
|
||||
handlers = on_message.handlers
|
||||
|
||||
Reference in New Issue
Block a user