This commit is contained in:
mii
2022-08-12 20:05:34 +09:00
parent 47b11262e2
commit 4161acbd45
4 changed files with 6 additions and 8 deletions

View File

@ -1,4 +1,4 @@
use serenity::{client::{EventHandler, Context}, async_trait, model::{gateway::Ready, interactions::{Interaction, application_command::ApplicationCommandInteraction, InteractionApplicationCommandCallbackDataFlags}, id::{GuildId, UserId}, channel::Message, prelude::{Member, application_command::{ApplicationCommandOptionType, ApplicationCommandOption, ApplicationCommand}}, voice::VoiceState}, framework::standard::macros::group};
use serenity::{client::{EventHandler, Context}, async_trait, model::{gateway::Ready, interactions::{Interaction, application_command::ApplicationCommandInteraction, InteractionApplicationCommandCallbackDataFlags}, id::{GuildId, UserId}, channel::Message, voice::VoiceState}};
use crate::{data::TTSData, tts::{instance::TTSInstance, message::AnnounceMessage}, implement::{member_name::ReadName, voice_move_state::{VoiceMoveStateTrait, VoiceMoveState}}, events};
pub struct Handler;
@ -38,8 +38,6 @@ async fn stop_command(ctx: &Context, command: &ApplicationCommandInteraction) ->
return Ok(());
}
let channel_id = channel_id.unwrap();
let manager = songbird::get(ctx).await.expect("Cannot get songbird client.").clone();
let storage_lock = {

View File

@ -1,4 +1,4 @@
use std::{path::Path, fs::File, io::Write, env};
use std::{fs::File, io::Write, env};
use async_trait::async_trait;
use serenity::{prelude::Context, model::prelude::Message};
@ -8,9 +8,10 @@ use crate::{
tts::{
instance::TTSInstance,
message::TTSMessage,
tts_type::TTSType,
gcp_tts::structs::{
audio_config::AudioConfig, synthesis_input::SynthesisInput, synthesize_request::SynthesizeRequest
}, tts_type::{self, TTSType}
}
},
};

View File

@ -7,7 +7,6 @@ pub trait VoiceMoveStateTrait {
pub enum VoiceMoveState {
JOIN,
LEAVE,
MOVE,
NONE
}

View File

@ -1,4 +1,4 @@
use std::{path::Path, fs::File, io::Write, env};
use std::{fs::File, io::Write, env};
use async_trait::async_trait;
use serenity::prelude::Context;
@ -34,7 +34,7 @@ pub struct AnnounceMessage {
#[async_trait]
impl TTSMessage for AnnounceMessage {
async fn parse(&self, instance: &mut TTSInstance, ctx: &Context) -> String {
async fn parse(&self, instance: &mut TTSInstance, _ctx: &Context) -> String {
instance.before_message = None;
format!(r#"<speak>アナウンス<break time="200ms"/>{}</speak>"#, self.message)
}