feat: got the commands mostly working, will need some further fine tuning
This commit is contained in:
parent
86a3af2a65
commit
86f54aec6d
4 changed files with 262 additions and 2 deletions
51
src/main.rs
51
src/main.rs
|
@ -1,7 +1,10 @@
|
|||
pub mod commands;
|
||||
|
||||
use crate::commands::role_adder::tools::on_role_change;
|
||||
use serenity::all::{ActivityData, Command, CreateMessage, EditInteractionResponse, GuildId, GuildMemberUpdateEvent, Interaction};
|
||||
use serenity::all::{
|
||||
ActivityData, Command, CommandDataOption, CommandDataOptionValue, CommandOptionType, CreateMessage, EditInteractionResponse, GuildId,
|
||||
GuildMemberUpdateEvent, Interaction,
|
||||
};
|
||||
use serenity::model::guild::Member;
|
||||
use serenity::{
|
||||
async_trait,
|
||||
|
@ -129,6 +132,7 @@ Sign up on [UL Wolves]({}) and go to https://discord.com/channels/{}/{} and use
|
|||
}
|
||||
}
|
||||
|
||||
// Inter-Committee server
|
||||
match GuildId::new(1220150752656363520)
|
||||
.set_commands(&ctx.http, vec![commands::count::committee::register()])
|
||||
.await
|
||||
|
@ -139,8 +143,16 @@ Sign up on [UL Wolves]({}) and go to https://discord.com/channels/{}/{} and use
|
|||
}
|
||||
}
|
||||
|
||||
// compsoc Server
|
||||
match GuildId::new(689189992417067052)
|
||||
.set_commands(&ctx.http, vec![commands::count::servers::register()])
|
||||
.set_commands(
|
||||
&ctx.http,
|
||||
vec![
|
||||
// commands just for the compsoc server
|
||||
commands::count::servers::register(),
|
||||
commands::server_icon::user::register(),
|
||||
],
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(_) => {}
|
||||
|
@ -175,6 +187,18 @@ Sign up on [UL Wolves]({}) and go to https://discord.com/channels/{}/{} and use
|
|||
Some(x) => match x.name.as_str() {
|
||||
"add" => commands::add_server::run(&command, &ctx).await,
|
||||
"roles_adder" => commands::role_adder::edit::run(&command, &ctx).await,
|
||||
"icon" => match &x.value {
|
||||
CommandDataOptionValue::SubCommandGroup(y) => match y.first() {
|
||||
None => "error".to_string(),
|
||||
Some(z) => match z.name.as_str() {
|
||||
"change" => commands::server_icon::admin::change::run(&command, &ctx).await,
|
||||
&_ => format!("not implemented :( count {}", x.name.as_str()),
|
||||
},
|
||||
},
|
||||
_ => {
|
||||
format!("not implemented :( committee {}", x.name.as_str())
|
||||
}
|
||||
},
|
||||
// "link" => commands::count::servers::run(&command, &ctx).await,
|
||||
&_ => format!("not implemented :( committee {}", x.name.as_str()),
|
||||
},
|
||||
|
@ -191,6 +215,29 @@ Sign up on [UL Wolves]({}) and go to https://discord.com/channels/{}/{} and use
|
|||
&_ => format!("not implemented :( count {}", x.name.as_str()),
|
||||
},
|
||||
},
|
||||
|
||||
"icon" => match command.data.options.first() {
|
||||
None => "Invalid Command".to_string(),
|
||||
Some(x) => match x.name.as_str() {
|
||||
"current" => {
|
||||
let result = match &x.value {
|
||||
CommandDataOptionValue::SubCommandGroup(y) => match y.first() {
|
||||
None => "error".to_string(),
|
||||
Some(z) => match z.name.as_str() {
|
||||
"icon" => commands::server_icon::user::current::icon::run(&command, &ctx).await,
|
||||
"festival" => commands::server_icon::user::current::festival::run(&command, &ctx).await,
|
||||
&_ => format!("not implemented :( count {}", x.name.as_str()),
|
||||
},
|
||||
},
|
||||
&_ => format!("not implemented :( {}", command.data.name.as_str()),
|
||||
};
|
||||
|
||||
result
|
||||
}
|
||||
"stats" => commands::server_icon::user::stats::run(&command, &ctx).await,
|
||||
&_ => format!("not implemented :( count {}", x.name.as_str()),
|
||||
},
|
||||
},
|
||||
_ => format!("not implemented :( {}", command.data.name.as_str()),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue