Add support for making Text-To-Speech send regular text messages instead of notices
When speech-to-text/flow-type = `only_transcribe`, the bot will now send text messages by default, not notices. While notice messages may be less desirable with other bots in the room, it's probably a better default for most people who enable "transcribe-only" mode. This is an improvement related to https://github.com/etkecc/baibot/issues/14
This commit is contained in:
@@ -12,5 +12,6 @@ pub fn get_file_extension(mime_type: &mime::Mime) -> String {
|
||||
(mime::IMAGE, mime::PNG) => "png",
|
||||
(mime::IMAGE, mime::SVG) => "svg",
|
||||
_ => "bin",
|
||||
}.to_string()
|
||||
}
|
||||
.to_string()
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ use crate::{
|
||||
};
|
||||
|
||||
pub mod agent;
|
||||
pub mod text_to_speech;
|
||||
pub(super) mod mime;
|
||||
pub mod text_to_speech;
|
||||
|
||||
pub async fn get_text_body_or_complain<'a>(
|
||||
bot: &Bot,
|
||||
|
||||
@@ -118,7 +118,10 @@ async fn do_generate_and_send_tts_for_message(
|
||||
}
|
||||
};
|
||||
|
||||
let attachment_body_text = format!("generated-speech.{}", get_file_extension(&text_to_speech_result.mime_type));
|
||||
let attachment_body_text = format!(
|
||||
"generated-speech.{}",
|
||||
get_file_extension(&text_to_speech_result.mime_type)
|
||||
);
|
||||
|
||||
let event_content = matrix_link
|
||||
.media()
|
||||
|
||||
Reference in New Issue
Block a user