use crate::client::{InlineButton, OutgoingMessage, TelegramBot};
pub async fn bot_conformance(bot: &dyn TelegramBot, chat_id: i64) {
let message = OutgoingMessage::new(chat_id, "cratefield conformance probe").row(vec![
InlineButton::callback("Acknowledge", "conformance:ack")
.expect("conformance callback data is within the 64-byte limit"),
]);
let sent = bot
.send_message(&message)
.await
.unwrap_or_else(|error| panic!("conformance: send_message failed: {error}"));
assert_eq!(
sent.chat_id, chat_id,
"conformance: send_message must echo the chat id back"
);
assert!(
sent.message_id > 0,
"conformance: send_message must report a positive message id, got {}",
sent.message_id
);
bot.edit_message(
chat_id,
sent.message_id,
"cratefield conformance probe (edited)",
&[],
)
.await
.unwrap_or_else(|error| panic!("conformance: edit_message failed: {error}"));
bot.delete_message(chat_id, sent.message_id)
.await
.unwrap_or_else(|error| panic!("conformance: delete_message failed: {error}"));
bot.answer_callback("conformance-callback-query-id", Some("acknowledged"))
.await
.unwrap_or_else(|error| panic!("conformance: answer_callback failed: {error}"));
}