mirror of
https://github.com/mii443/ncb-chat.git
synced 2025-08-22 16:15:27 +00:00
36 lines
939 B
Rust
36 lines
939 B
Rust
use serenity::{model::prelude::command::Command, model::prelude::Ready, prelude::Context};
|
|
|
|
pub async fn ready(ctx: Context, ready: Ready) {
|
|
println!("{} is connected!", ready.user.name);
|
|
|
|
let mut llama = true;
|
|
let mut chatgpt = true;
|
|
|
|
for command in Command::get_global_application_commands(&ctx.http)
|
|
.await
|
|
.unwrap()
|
|
{
|
|
if command.name == "llama" {
|
|
llama = false;
|
|
}
|
|
if command.name == "chatgpt" {
|
|
chatgpt = false;
|
|
}
|
|
}
|
|
|
|
if llama {
|
|
Command::create_global_application_command(&ctx.http, |command| {
|
|
command.name("llama").description("Start llama chat.")
|
|
})
|
|
.await
|
|
.unwrap();
|
|
}
|
|
if chatgpt {
|
|
Command::create_global_application_command(&ctx.http, |command| {
|
|
command.name("chatgpt").description("Start ChatGPT chat.")
|
|
})
|
|
.await
|
|
.unwrap();
|
|
}
|
|
}
|