Skip to content

Releases: lsdrfrx/telegram_ex

v1.3.0

Choose a tag to compare

@lsdrfrx lsdrfrx released this 10 Jul 15:52

Added

  • defcommand macro for defining commands with arguments and options
  • Automatic registration of commands via Telegram setMyCommands
  • TelegramEx.Error struct to describe API errors
  • TelegramEx.Effect for pipeline-friendly builders with short-circuiting errors
  • TelegramEx.Builder.Voice for sending voice messages by file ID, URL, or local file path
  • TelegramEx.MimeType for resolving uploaded file content types from extensions
  • audio and reply_to_message fields in TelegramEx.Types.Message
  • Detailed guides for commands, effects, examples, FSM, routers, media, development, and getting started
  • Contribution guidelines in CONTRIBUTING.md

Changed

  • Builders now accept either a raw handler context or an existing TelegramEx.Effect
  • File payload handling is shared through TelegramEx.Builder.put_file_payload/3
  • Local media uploads now use extension-based MIME types instead of hardcoded content types
  • API error responses are returned as structured TelegramEx.Error values

Fixed

  • Added a from_map/1 clause for nil nested messages to avoid failures when optional reply messages are absent
  • Fixed Dialyzer issues in message conversion specs

v1.2.1

Choose a tag to compare

@lsdrfrx lsdrfrx released this 18 May 18:03
c181064

Added

  • TelegramEx.Builder.Poll for sending polls and quizzes
  • Proper library documentation

v1.2.0

Choose a tag to compare

@lsdrfrx lsdrfrx released this 13 Apr 18:14

Added

  • TelegramEx.Builder.Sticker for sending stickers (by id, url, file path)
  • TelegramEx.Builder.Location for sending geo coordinates
  • TelegramEx.Builder.Video for sending videos (by id, url, file path) with duration and cover support
  • TelegramEx.Builder.Contact for sending contacts
  • Example project in example/ folder as quick review of all features
  • Sending messages to concrete threads in forum chats via message_thread_id
  • TelegramEx.Router macro to group handlers by logic into routers

Changed

  • All builders now accept ctx as the first argument and store payload inside ctx.payload
  • API.request/1 accepts full context map instead of separate token, method, payload arguments
  • Builders' send/2 delegates to API.request/1 through context — no more Process.get(:token)

v1.1.0

Choose a tag to compare

@lsdrfrx lsdrfrx released this 27 Mar 16:52
2389e9a

Added

  • TelegramEx.FSM module with defstate/2 macro to make stateful handlers
  • Multiple bot support via names
  • Fallback update handlers

v1.0.0

Choose a tag to compare

@lsdrfrx lsdrfrx released this 08 Mar 14:37

Key Features

  • Macro-based architecture — similar to GenServer, allows creating bots through use TelegramEx
  • Message handling — built-in support for incoming messages, callback queries, and inline queries
  • Automatic polling — the library automatically polls the Telegram API
  • Builder API — convenient builders for sending text, photos, and documents
  • Keyboards — support for inline keyboards and reply keyboards

What's Supported

  • Sending text messages with Markdown/HTML
  • Sending photos and documents by URL or local path
  • Inline and reply keyboards
  • Handling callback queries from buttons
  • Automatic polling of the Telegram Bot API

See the detailed documentation in README.

Package available on Hex.pm