diff options
Diffstat (limited to '')
| -rw-r--r-- | src/commands/ai.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/commands/ai.rs b/src/commands/ai.rs index a7a9a7e..61fb471 100644 --- a/src/commands/ai.rs +++ b/src/commands/ai.rs | |||
| @@ -30,18 +30,8 @@ pub async fn senator( | |||
| 30 | }) | 30 | }) |
| 31 | .ok_or_else(lang::err_not_in_voice)?; | 31 | .ok_or_else(lang::err_not_in_voice)?; |
| 32 | 32 | ||
| 33 | let tts_url = format!( | 33 | let (audio_data, _) = |
| 34 | "https://translate.google.com/translate_tts?ie=UTF-8&q={}&tl=pl&client=tw-ob", | 34 | crate::tts::synthesize(&ctx.data().config, &ctx.data().http_client, &response).await?; |
| 35 | crate::commands::tts::urlencoding(&response) | ||
| 36 | ); | ||
| 37 | let audio_data = ctx | ||
| 38 | .data() | ||
| 39 | .http_client | ||
| 40 | .get(&tts_url) | ||
| 41 | .send() | ||
| 42 | .await? | ||
| 43 | .bytes() | ||
| 44 | .await?; | ||
| 45 | 35 | ||
| 46 | let call = ctx | 36 | let call = ctx |
| 47 | .data() | 37 | .data() |
