You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for message_thread_id across all Send-* functions #57
Currently, PoshGram does not support sending messages (or other media) to a specific forum topic (thread) in supergroups.
The Telegram Bot API provides the message_thread_id parameter in several methods (e.g., sendMessage, sendPhoto, sendDocument, sendVideo, etc.).
Without this parameter, bots cannot target a specific topic, which significantly limits their usefulness in forum-style supergroups.
Describe the solution you'd like
Add an optional parameter MessageThreadID (mapped to message_thread_id in the Telegram Bot API) across all relevant PoshGram functions (Send-TelegramTextMessage, Send-TelegramLocalPhoto, Send-TelegramLocalDocument, etc.).
When provided, the parameter should be included in the payload.
When omitted, the default behavior remains unchanged (messages go to the root chat).
Describe any alternatives you've considered
Manually modifying individual functions in the module to inject message_thread_id into the payload. This works but is not maintainable, since every update overwrites custom edits.
Sending messages only to the root chat without topic assignment, but this removes the ability to organize content into threads.
Additional context
Telegram Bot API reference: sendMessage and related methods.
Relevant field: message_thread_id – Unique identifier for the target message thread (topic) of the forum; for forum supergroups only.
Activity