Skip to content

Commit

Permalink
fix: correct set secret header
Browse files Browse the repository at this point in the history
  • Loading branch information
bondiano committed Sep 30, 2024
1 parent e9434e6 commit f780389
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/04-keyboard-bot/src/bot.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ fn handle_inline_change_language(

let assert Ok(language_callback) =
telega_keyboard.unpack_callback(payload, callback_data)

let language = language_callback.data

use _ <- result.try(reply.answer_callback_query(
Expand Down
2 changes: 1 addition & 1 deletion examples/04-keyboard-bot/src/language_keyboard.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn new_keyboard(lang: Language) {
|> keyboard.one_time
}

pub fn option_to_language(option: String) -> Language {
pub fn option_to_language(option: String) {
case option {
"🇷🇺 Russian" -> Russian
"🇬🇧 Английский" -> English
Expand Down
2 changes: 1 addition & 1 deletion src/telega/adapters/wisp.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import wisp.{
Empty as WispEmptyBody,
}

const secret_header = "X-Telegram-Bot-Api-Secret-Token"
const secret_header = "x-telegram-bot-api-secret-token"

/// A middleware function to handle incoming requests from the Telegram API.
/// Handles a request to the bot webhook endpoint, decodes the incoming message,
Expand Down
2 changes: 1 addition & 1 deletion src/telega/keyboard.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ pub opaque type KeyboardCallbackData(data) {

pub type KeyboardCallback(data) {
KeyboardCallback(
data: data,
id: String,
payload: String,
data: data,
callback_data: KeyboardCallbackData(data),
)
}
Expand Down

0 comments on commit f780389

Please sign in to comment.