mirror of
https://github.com/mii443/ncb-tts-r2.git
synced 2025-08-23 16:39:24 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
6aec4e4ea7 | |||
2bf2fe05f1 | |||
f99d37ea56 |
20
Dockerfile
20
Dockerfile
@ -1,16 +1,18 @@
|
||||
FROM ubuntu:22.04
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y ffmpeg libssl-dev pkg-config libopus-dev wget curl gcc \
|
||||
&& apt-get -y clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
|
||||
ENV PATH $PATH:/root/.cargo/bin/
|
||||
RUN rustup install stable
|
||||
WORKDIR /usr/src/ncb-tts-r2
|
||||
COPY Cargo.toml .
|
||||
COPY src src
|
||||
RUN cargo build --release \
|
||||
ENV PATH $PATH:/root/.cargo/bin/
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y ffmpeg libssl-dev pkg-config libopus-dev wget curl gcc \
|
||||
&& apt-get -y clean \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable \
|
||||
&& rustup install stable \
|
||||
&& cargo build --release \
|
||||
&& cp /usr/src/ncb-tts-r2/target/release/ncb-tts-r2 /usr/bin/ncb-tts-r2 \
|
||||
&& mkdir -p /ncb-tts-r2/audio
|
||||
&& mkdir -p /ncb-tts-r2/audio \
|
||||
&& apt-get purge -y pkg-config wget curl gcc \
|
||||
&& rustup self uninstall -y
|
||||
WORKDIR /ncb-tts-r2
|
||||
CMD ["ncb-tts-r2"]
|
@ -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}}, 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, ApplicationCommand}}, voice::VoiceState}, framework::standard::macros::group};
|
||||
use crate::{data::TTSData, tts::{instance::TTSInstance, message::AnnounceMessage}, implement::member_name::ReadName};
|
||||
|
||||
#[group]
|
||||
@ -281,10 +281,7 @@ impl EventHandler for Handler {
|
||||
|
||||
async fn ready(&self, ctx: Context, ready: Ready) {
|
||||
println!("{} is connected!", ready.user.name);
|
||||
|
||||
let guild_id = GuildId(660046656934248460);
|
||||
|
||||
let commands = GuildId::set_application_commands(&guild_id, &ctx.http, |commands| {
|
||||
let _ = ApplicationCommand::set_global_application_commands(&ctx.http, |commands| {
|
||||
commands.create_application_command(|command| {
|
||||
command.name("stop")
|
||||
.description("Stop tts")
|
||||
@ -295,8 +292,8 @@ impl EventHandler for Handler {
|
||||
});
|
||||
commands.create_application_command(|command| {
|
||||
command.name("config")
|
||||
.description("Config")
|
||||
})
|
||||
}).await;
|
||||
println!("{:?}", commands);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user