1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-22 11:04:21 +00:00

Hide suffix in /help if in a private chat

This commit is contained in:
Steffo 2024-07-08 05:48:33 +02:00
parent 8f6d0a1511
commit 8fee150c41
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -57,7 +57,12 @@ pub async fn handler_specific(bot: &Bot, message: &Message, target: &str) -> Com
None => anyhow::bail!("Non è stato possibile trovare il comando specificato."), None => anyhow::bail!("Non è stato possibile trovare il comando specificato."),
}; };
let text = format!("❓ Il comando {}{}:\n\n{}", target.command, suffix, target.description); let display_suffix = match message.chat.is_private() {
false => &suffix,
true => "",
};
let text = format!("❓ Il comando {}{}:\n\n{}", target.command, display_suffix, target.description);
let _reply = bot let _reply = bot
.send_message(message.chat.id, text) .send_message(message.chat.id, text)