diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-08-05 20:32:45 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-08-05 20:32:45 +0200 |
commit | 0ef059378e3b10c0eebcbb4e5abc0e033f06cd25 (patch) | |
tree | a9e5761039205bf132a61f46f35fdd0c260902ee /src/keyboard.rs | |
parent | eaafe83dae4c12d44c9c7672a3b02c04b110cf6b (diff) |
chore: get chat_id to create the button for callback
Diffstat (limited to 'src/keyboard.rs')
-rw-r--r-- | src/keyboard.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/keyboard.rs b/src/keyboard.rs index ea57d66..8cee93d 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -5,6 +5,7 @@ use teloxide::types::{InlineKeyboardButton, InlineKeyboardMarkup}; pub async fn make_inline_keyboard( hashmap: &Option<HashMap<String, String>>, callback_type: &str, + chat_id: i64, ) -> InlineKeyboardMarkup { // This is an array of array because the `InlineKeyboardMarkup` // considers each array as a row. @@ -16,7 +17,7 @@ pub async fn make_inline_keyboard( for (key, value) in options { keyboard_array.push(vec![InlineKeyboardButton::callback( value.clone(), - format!("{}_{}", callback_type, key), + format!("{}_{}_{}", chat_id, callback_type, key), )]); } } else { |