Minor fun fixes
This commit is contained in:
parent
513b2c2b6d
commit
a2b0e2e8a8
@ -127,9 +127,20 @@ pub async fn players(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[poise::command(slash_command)]
|
#[poise::command(slash_command)]
|
||||||
pub async fn join(
|
pub async fn join(ctx: poise::Context<'_, Data, serenity::Error>) -> Result<(), serenity::Error> {
|
||||||
ctx: poise::Context<'_, Data, serenity::Error>,
|
let cache = ctx.data().cached_reply.lock().await;
|
||||||
) -> Result<(), serenity::Error> {
|
match cache.as_ref().unwrap() {
|
||||||
ctx.say(format!("To join, type `{}` in the server URL box or search bar.", ctx.data().server.addressable_name())).await?;
|
ServerResponse::Offline => {
|
||||||
|
ctx.say("Server is offline! Cannot get server info.").await?;
|
||||||
|
},
|
||||||
|
ServerResponse::Online(on) => {
|
||||||
|
ctx.say(format!(
|
||||||
|
"To join, type `{}` in the server URL box or search bar.\nEnsure you are on version `{}`.",
|
||||||
|
on.searchable_name,
|
||||||
|
on.version
|
||||||
|
))
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
};
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user