- Voice-To-Text ignoriert Sprachnachrichten mit einer Länge von > 90 Sekunden

- Upstream
This commit is contained in:
Andreas Bielawski 2016-08-30 23:45:44 +02:00
commit 9379714f4e
2 changed files with 8 additions and 2 deletions

View File

@ -31,8 +31,13 @@ function remind:action(msg, config)
elseif duration > config.remind.max_duration then
duration = config.remind.max_duration
end
local message = utilities.input(input)
if not message then
local message
if msg.reply_to_message and #msg.reply_to_message.text > 0 then
message = msg.reply_to_message.text
elseif utilities.input(input) then
message = utilities.input(input)
else
utilities.send_reply(msg, remind.doc, true)
return
end

View File

@ -10,6 +10,7 @@ function vtt:pre_process(msg, config)
if not msg.voice then return msg end -- Ignore
local mime_type = msg.voice.mime_type
if mime_type ~= 'audio/ogg' then return msg end -- We only want to transcript voice messages
if msg.voice.duration > 90 then return msg end -- Only voice messages < 60 seconds
local file_id = msg.voice.file_id
local file_size = msg.voice.file_size
if file_size > 19922944 then