dev #25

Merged
akulij merged 38 commits from dev into main 2025-06-18 17:10:44 +00:00
Showing only changes of commit 6e31fa86e6 - Show all commits

View File

@ -66,6 +66,23 @@ where
))
}
pub async fn callback_button<C, D>(
name: &str,
callback_name: String,
callback_data: C,
db: &mut D,
) -> BotResult<InlineKeyboardButton>
where
C: Serialize + for<'a> Deserialize<'a> + Send + Sync,
D: CallDB + Send + Sync,
{
let ci = CallbackInfo::new_with_literal(callback_data, callback_name)
.store(db)
.await?;
Ok(InlineKeyboardButton::callback(name, ci.get_id()))
}
#[cfg(test)]
mod tests {
use super::*;