new-member-message-brendan #20

Merged
silver merged 9 commits from silver/discord-bot:new-member-message-brendan into new-member-message 2024-09-17 21:30:47 +00:00
Showing only changes of commit c71dbe7214 - Show all commits

View file

@ -45,7 +45,7 @@ pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> Stri
};
let mut role_past = None;
if let Some(x) = command.data.options.get(2) {
if let Some(x) = command.data.options.get(5) {
if let Some(CommandDataOptionValue::Role(role)) = &x.resolved {
role_past = Some(role.id.to_owned());
}
@ -54,7 +54,7 @@ pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> Stri
let bot_channel_id = if let CommandDataOptionValue::Channel(channel) = command
.data
.options
.get(3)
.get(2)
.expect("Expected channel option")
.resolved
.as_ref()
@ -68,7 +68,7 @@ pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> Stri
let server_name = if let CommandDataOptionValue::String(name) = command
.data
.options
.get(4)
.get(3)
.expect("Expected Server Name option")
.resolved
.as_ref()
@ -82,7 +82,7 @@ pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> Stri
let wolves_link = if let CommandDataOptionValue::String(wolves) = command
.data
.options
.get(5)
.get(4)
.expect("Expected Wolves Link option")
.resolved
.as_ref()
@ -140,13 +140,6 @@ pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicatio
.kind(CommandOptionType::Role)
.required(true)
})
.create_option(|option| {
option
.name("role_past")
.description("Role for Past members")
.kind(CommandOptionType::Role)
.required(false)
})
.create_option(|option| {
option
.name("bot_channel")
@ -168,6 +161,13 @@ pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicatio
.kind(CommandOptionType::String)
.required(true)
})
.create_option(|option| {
option
.name("role_past")
.description("Role for Past members")
.kind(CommandOptionType::Role)
.required(false)
})
}
async fn add_server(db: &Pool<Sqlite>, ctx: &Context, server: &Servers) -> Result<Option<Servers>, Error> {