mirror of
https://github.com/mii443/ncb-tts-r2.git
synced 2025-08-23 00:25:31 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
3652079bab | |||
8a4de65a8a |
@ -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, 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, prelude::{Member, application_command::{ApplicationCommandOptionType, ApplicationCommandOption}}, voice::VoiceState}, framework::standard::macros::group};
|
||||
use crate::{data::TTSData, tts::{instance::TTSInstance, message::AnnounceMessage}, implement::member_name::ReadName};
|
||||
|
||||
#[group]
|
||||
@ -292,6 +292,9 @@ impl EventHandler for Handler {
|
||||
commands.create_application_command(|command| {
|
||||
command.name("setup")
|
||||
.description("Setup tts")
|
||||
});
|
||||
commands.create_application_command(|command| {
|
||||
command.name("config")
|
||||
})
|
||||
}).await;
|
||||
println!("{:?}", commands);
|
||||
|
@ -1,4 +1,4 @@
|
||||
use std::{path::Path, fs::File, io::Write};
|
||||
use std::{path::Path, fs::File, io::Write, env};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use serenity::{prelude::Context, model::prelude::Message};
|
||||
@ -80,8 +80,7 @@ impl TTSMessage for Message {
|
||||
|
||||
let uuid = uuid::Uuid::new_v4().to_string();
|
||||
|
||||
let root = option_env!("CARGO_MANIFEST_DIR").unwrap();
|
||||
let path = Path::new(root);
|
||||
let path = env::current_dir().unwrap();
|
||||
let file_path = path.join("audio").join(format!("{}.mp3", uuid));
|
||||
|
||||
let mut file = File::create(file_path.clone()).unwrap();
|
||||
|
@ -1,4 +1,4 @@
|
||||
use std::{path::Path, fs::File, io::Write};
|
||||
use std::{path::Path, fs::File, io::Write, env};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use serenity::prelude::Context;
|
||||
@ -64,8 +64,7 @@ impl TTSMessage for AnnounceMessage {
|
||||
|
||||
let uuid = uuid::Uuid::new_v4().to_string();
|
||||
|
||||
let root = option_env!("CARGO_MANIFEST_DIR").unwrap();
|
||||
let path = Path::new(root);
|
||||
let path = env::current_dir().unwrap();
|
||||
let file_path = path.join("audio").join(format!("{}.mp3", uuid));
|
||||
|
||||
let mut file = File::create(file_path.clone()).unwrap();
|
||||
|
Reference in New Issue
Block a user