Minor fun fixes

This commit is contained in:
August 2026-05-06 19:29:38 -04:00
parent 513b2c2b6d
commit a2b0e2e8a8
Signed by: shibedrill
SSH Key Fingerprint: SHA256:M0m3JW1s38BgO2t0fG146Yxd9OJ2IOqkvCAsuRHQ6Pw

View File

@ -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(())
} }