Skip to content

Commit

Permalink
Merge pull request #70 from resuelve/feature/hsm_media_button_dynamic
Browse files Browse the repository at this point in the history
Added functionality for hsm media dinamyc button
  • Loading branch information
LaErika authored Nov 13, 2023
2 parents 7529c15 + c1aa371 commit 490415d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions lib/models/message_outbound_media_id_hsm.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ defmodule Whatsapp.Models.MessageOutboundMediaIdHsm do
params: nil,
type: nil,
media_id: nil,
file_name: nil
file_name: nil,
components: nil
)

@valid_language_policies ["deterministic"]
Expand Down Expand Up @@ -127,16 +128,19 @@ defmodule Whatsapp.Models.MessageOutboundMediaIdHsm do
code: message.language_code
},
name: message.element_name,
components: [
%{
type: "header",
parameters: [_convert_to_parameter(message.type, message.media_id, message.file_name)]
},
%{
type: "body",
parameters: _format_params(message.params)
}
]
components:
[
%{
type: "header",
parameters: [
_convert_to_parameter(message.type, message.media_id, message.file_name)
]
},
%{
type: "body",
parameters: _format_params(message.params)
}
] ++ message.components
}
}
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule WhatsappApi.MixProject do
[
app: :wax,
elixirc_paths: elixirc_paths(Mix.env()),
version: "0.8.0",
version: "0.8.1",
description: "Whatsapp Elixir Client",
elixir: "~> 1.6",
package: package(),
Expand Down

0 comments on commit 490415d

Please sign in to comment.