# Changelog
## Unreleased
## [0.64.0]
- Add Bot init hooks, allow to hook on bot's init to execute custom methods.
- Add `get_me: boolean()` option to `use ExGram.Bot` to enable/disable initial get_me. It's enabled by default.
- Breaking: Now to disable initial get_me call, instead of using a hardcoded username it's `get_me: false`
## [0.63.0]
- Spawn on handler attaching opentelemetry context if provided
- Add opentelemetry guide
## [0.62.0]
- Add :telemetry integration
- Improve testing capabilities using :telemetry to automatically call ExGram.Test.allow on the bot's dispatcher and updates
## [0.61.0]
- Keyboards detect row of rows and unwraps them, allowing for dynamic building of rows
- Custom inspect for keyboard
- Support for custom webhook paths in production deployments (default: "/telegram")
- Improved Cast.cast with type checking in more types
## [0.60.0]
- Clean README.md and separate content in different guides in [./guides](./guides)
- Added `:scopes` and `:lang` options to the `command` macro ( #202 by @txssu )
- Added ExGram.Dsl.MessageEntityBuilder to build messages with MessageEntity instead of markdown or html
- If `MDEx` is installed as a dependency, a module `ExGram.Markdown` will be provided to transform from markdown to MessageEntities.
- Improved ExGram.Dsl.Keyboard macros and helpers
- Improved `ExGram.Adapter.Test` to enable actually real and useful tests
- Added `on_result` DSL to "interject" the result of the previous enqueued action
- Simplified the Macros.Helper, now it's easier to deal with params AST
- Added parameters description to models and methods @doc field
- Fix Tesla and Req adapters to return proper Telegram errors
- Added the possibility to pass `chat_id` and `message_id` directly to delete and edit DSL helpers
- Fix ignore username middleware not working when the message has a newline after the command `"/command\nhey"` (#200)
- `extract_info` looks at phono's `caption` to check for commands/regex (#201)
## [0.58.0]
- Update to version 9.5
- Added support to multiple return types on casting (fixes #196)
- Implemented Subtype protocol to 10 generic types missing.
- Added credo check to make sure new generic types don't miss the protocol implementation
- Added support to media input files (fixes #195)
- Add timeouts to Req adapter to handle longpolling correctly
- Add missing types and updates on `extract_user`, `extract_chat` and `extract_update_type`
## [0.57.0]
- Update to Elixir 1.19 and Erlang 28.1.1
- Update ex_doc dependency
- Added CI
- Added Req adapter
## [0.56.1}
- Fix paid reaction type: https://github.com/rockneurotiko/ex_gram/pull/192 by @prtngn
## [0.56.0]
- Update to version 9.1: https://core.telegram.org/bots/api-changelog#july-3-2025
- Fix: `init/1` callback is called on Dispatcher init instead of Supervisor init, allowing to the user to have the Dispatcher pid
- Change: `middleware_halted` now stop the request.
## [0.55.1]
- Fix: Only reload JSON engine of configuration is set
## [0.55.0]
- Update Telegram API to 9.0: https://core.telegram.org/bots/api#april-11-2025
- Update Telegram API to 8.3: https://core.telegram.org/bots/api#february-12-2025
## [0.54.0]
- Add ExGram.Cast to convert responses to models
- Fix webhook response casting, now all should be models
- Fix webhook options allowed_updates when sending a multipart
## [0.53.0]
- Update Telegram API to 7.5: https://core.telegram.org/bots/api#june-18-2024
- Breaking changes from the API:
- `ExGram.get_chat` now returns the new `ExGram.Model.ChatFullInfo` instead of `ExGram.Model.Chat`
- `ExGram.send_invoice`, `ExGram.create_invoice_link` and now have 1 less mandatory param, `provider_token` now is optional. If `nil` it will use telegram stars
- `ExGram.Model.Chat` now have less fields, to get the full chat you need to use `ExGram.get_chat`
## [0.52.2]
- Update Telegram API to 7.2: https://core.telegram.org/bots/api#march-31-2024
## [0.52.1]
- Fix ChatBoostSource, MaybeInaccessibleMessage, MessageOrigin and ReactionType subtypes for decoding
## [0.52.0]
- DSL public method changes:
- Deprecated `extract_group`, now it's called `extract_chat`
- `extract_update_type` now returns `{:ok, type} | :error` instead of `type | :error`
- `extract_message_type` now returns `{:ok, type} | :error` instead of `type | :error`
- Fix decoding inner structs on messages
- Remove maxwell
- Remove inch_ex
- Webhook url supports protocol and port
- Add and apply styler
## [0.51.1]
- Fix #131. Now multi bots with the same module is possible.
## [0.51.0]
- Added options on polling and webhook methods.
WARNING: If you use custom module for method updates, the initial parameters passed to the `start_link/1` has changed. Before: `{:bot, pid, :token, token}` Now: `%{bot: pid, token: token}` + options configured on children setup
## [0.50.2]
- Update Telegram API to 7.1: https://core.telegram.org/bots/api#february-16-2024
## [0.50.1]
- Fix timeout on different Tesla adapters
## [0.50.0]
- Update Telegram API to 7.0: https://core.telegram.org/bots/api#december-29-2023
## [0.41.0]
- Update Telegram API to 6.8: https://core.telegram.org/bots/api#august-18-2023
- Fix return types for arrays
## [0.40.0]
- getMyCommands and deleteWebhook has parameters
- Update Telegram API to 6.7: https://core.telegram.org/bots/api#april-21-2023
- Models fields now can have union types
- Add Webhook updates adapter
- Remove InputFile, it wasn't a real model
## [0.34.0]
- Update Telegram API to 6.6: https://core.telegram.org/bots/api#march-9-2023
- Breaking changes from the API:
`thumb` fields renamed to `thumbnail` on models and methods.
## [0.33.0]
- Update Telegram API to 6.5: https://core.telegram.org/bots/api#february-3-2023
- import Config instead of use Mix.Config
## [0.32.0]
- Add test_environment config and build path accordingly
## [0.31.0]
- Update Telegram API to 6.4: https://core.telegram.org/bots/api#december-30-2022
## [0.30.0]
- Update Telegram API to 6.3: https://core.telegram.org/bots/api#november-5-2022
## [0.29.0]
- Add SendDocument response and answer_document DSL
## [0.28.0]
- [Major] Update Telegram API to 6.2: https://core.telegram.org/bots/api#august-12-2022
## [0.27.0]
- [Major] Update Telegram API to 6.0: https://core.telegram.org/bots/api#april-16-2022
## [0.26.0]
- Update Telegram API to 5.6
## [0.25.0]
- Update Telegram API to 5.4
## [0.24.1]
- Add original API descriptions to methods and models
## [0.24.0]
- Update Telegram API to 5.3
- Breaking changes from the API:
Renamed method kickChatMember to banChatMember
Renamed method getChatMembersCount to getChatMemberCount
ChatMember now has specific subtypes (ChatMemberOwner, ChatMemberAdministrator, ChatMemberMember, ChatMemberRestricted, ChatMemberLeft, ChatMemberBanned)
BotCommandScope now has specific subtypes (BotCommandScopeDefault, BotCommandScopeAllPrivateChats, BotCommandScopeAllGroupChats, BotCommandScopeAllChatAdministrators, BotCommandScopeChat, BotCommandScopeChatAdministrators, BotCommandScopeChatMember)
## [0.23.0]
- Update Telegram API to 5.2
## [0.22.0]
- Update Telegram API to 5.1
- Add credo and fix all the issues
## [0.21.0]
- Add `{:file_content, "CONTENT", "filename.ext"}` format on `file` fields to send content directly instead of using a file path
## [0.20.0]
- Big refactor fixing bugs on the process
## [0.15.0]
- Update Telegram API to 5.0
- extractor.py now copy to clipboard the autogenerated text
## [0.14.0]
- Update Telegram API to 4.8
## [0.13.0]
- Use Supervisor.init instead of supervisor/1
- Add "description" option to `command` macro
- Add `setup_commands` option to `use ExGram.Bot` to send the commands at startup
## [0.12.0]
- Use new generator using a generic JSON
## [0.11.0]
- Update Telegram API to 4.7
## [0.10.0]
- Update Telegram API to 4.6
## [0.9.0]
- Warn when fetching token by bot's name and there are no token
- Update Telegram API to 4.5
## [0.8.1]
- Add the ability to configure custom tesla middlewares
- Fix regex macros, couldn't compile
## [0.8.0]
- Add Tesla adapter for HTTP and setting it as default
- Add ability to select Tesla adapter (tested with hackney and gun)
- Added documentation
- Added template for creating a bot
## [0.7.1]
- Fix an error when not receiving updates the local update_id keeps increasing and makes an infinite loop of retrieving updates
## [0.7.0]
- Update to BOT API 4.4
- Set a softer version in README
## [0.6.2]
- Update to BOT API 4.3
## [0.6.1]
- Update to BOT API 4.2
- Add default handle_info handler and change timeout
- Remove Supervisor.Spec uses, clean start_link and child_spec code
## [0.6.0]
- Handle when update_worker is nil and raise a better message
- Add `{:edited_message, msg}` message
- Relax hackney version
- Allow to specify JSON engine to use `config :ex_gram, json_encoder: Jason`
- Http implementation details moved from `ExGram` to `ExGram.Adapter.Http`