Skip to content

Commit 020c290

Browse files
committed
Use links in version output
1 parent 601223f commit 020c290

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

bot/src/bot.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::str::FromStr;
44

55
use poise::serenity_prelude::GatewayIntents;
66
use poise::{async_trait, CreateReply};
7+
use protocol::VersionResponse;
78
use rusqlite::{named_params, Connection, OpenFlags};
89
use serenity::builder::{CreateAllowedMentions, CreateAttachment};
910
use tokio::join;
@@ -448,13 +449,15 @@ async fn version(ctx: Context<'_>) -> Result<(), PoiseError> {
448449
let res = pool.lock().await.version().await;
449450

450451
match res {
451-
Ok(typst_version) => {
452-
let message = format!(
453-
"The bot was built from git hash `{}`\nThe bot is using Typst version {}, git hash `{}`",
454-
env!("BUILD_SHA"),
455-
typst_version.version,
456-
typst_version.git_hash,
457-
);
452+
Ok(VersionResponse {
453+
git_hash: typst_hash,
454+
version: typst_version,
455+
}) => {
456+
let bot_hash = env!("BUILD_SHA");
457+
let message = format!("\
458+
The bot was built from git hash [`{bot_hash}`](<https://github.com/mattfbacon/typst-bot/tree/{bot_hash}>)
459+
The bot is using Typst version **{typst_version}**, git hash [`{typst_hash}`](<https://github.com/typst/typst/tree/{typst_hash}>)\
460+
");
458461
ctx.reply(message).await?;
459462
}
460463
Err(error) => {

0 commit comments

Comments
 (0)