diff --git a/src/bot_runner.rs b/src/bot_runner.rs index 095d82b..1dfb968 100644 --- a/src/bot_runner.rs +++ b/src/bot_runner.rs @@ -127,9 +127,20 @@ pub async fn players( } #[poise::command(slash_command)] -pub async fn join( - ctx: poise::Context<'_, Data, serenity::Error>, -) -> Result<(), serenity::Error> { - ctx.say(format!("To join, type `{}` in the server URL box or search bar.", ctx.data().server.addressable_name())).await?; +pub async fn join(ctx: poise::Context<'_, Data, serenity::Error>) -> Result<(), serenity::Error> { + let cache = ctx.data().cached_reply.lock().await; + match cache.as_ref().unwrap() { + 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(()) } \ No newline at end of file