forked from sorceress/rustcord
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]
|
#[command]
|
||||||
async fn spoiler(ctx: &Context, message: &Message, args: Args) -> CommandResult {
|
async fn spoiler(ctx: &Context, message: &Message, args: Args) -> CommandResult {
|
||||||
// check if the message has any attachments
|
// check if the message has any attachments
|
||||||
let attachments = match message.attachments.is_empty() {
|
|
||||||
true => {
|
let attachments = if message.attachments.is_empty() {
|
||||||
return Err("No images were attached!".into());
|
return Err("No images were attached!".into());
|
||||||
}
|
} else {
|
||||||
false => &message.attachments,
|
&message.attachments
|
||||||
};
|
};
|
||||||
|
|
||||||
// get the author's nick in the server, otherwise default to global username later
|
// get the author's nick in the server, otherwise default to global username later
|
||||||
|
|
Loading…
Reference in New Issue