Replace match on true/false with if in spoile.rs::spoiler
This commit is contained in:
parent
aecdc7a273
commit
f89eb2842c
|
@ -10,11 +10,11 @@ use serenity::{
|
|||
#[command]
|
||||
async fn spoiler(ctx: &Context, message: &Message, args: Args) -> CommandResult {
|
||||
// check if the message has any attachments
|
||||
let attachments = match message.attachments.is_empty() {
|
||||
true => {
|
||||
return Err("No images were attached!".into());
|
||||
}
|
||||
false => &message.attachments,
|
||||
|
||||
let attachments = if message.attachments.is_empty() {
|
||||
return Err("No images were attached!".into());
|
||||
} else {
|
||||
&message.attachments
|
||||
};
|
||||
|
||||
// get the author's nick in the server, otherwise default to global username later
|
||||
|
|
Loading…
Reference in New Issue