Skip to content

Make SendOption exportable#83

Open
kukymbr wants to merge 3 commits into
yanzay:masterfrom
kukymbr:exportable-send-option
Open

Make SendOption exportable#83
kukymbr wants to merge 3 commits into
yanzay:masterfrom
kukymbr:exportable-send-option

Conversation

@kukymbr

@kukymbr kukymbr commented Mar 22, 2026

Copy link
Copy Markdown

Hi,

tbot seems to be useful and compact wrapper around the telegram API.

I'm proposing to make the sendOption type exportable, because there could be cases when some message factory is used before sending.

For example, on my project I have some message types (like MarkdownMessage, ErrorMessage, etc), the Sender interface and implementation for multiple IM's. And the TelegramSender needs to build message options dynamically (example from current implementation for a telebot library):

to, toOpts := recipientToTelebotRecipient(recipient)
opts := make([]any, 0, len(toOpts)+len(arg.opts))

opts = append(opts, arg.opts...)
opts = append(opts, toOpts...)

msg, err := bot.Send(to, arg.what, opts...)

But it's not possible if options are represented by an unexportable type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant