Categorygithub.com/rusq/tbcomctl/v3
modulepackage
3.0.2
Repository: https://github.com/rusq/tbcomctl.git
Documentation: pkg.go.dev

# README

=================================== Common Controls Library for Telebot

Library provides common controls to use with Telebot_ library.

  • Picklist
  • Rating
  • Post Buttons
  • Keyboard
  • Middleware
  • Helper functions for logging.

.. _Telebot: https://github.com/tucnak/telebot

# Packages

No description provided by the author

# Functions

ButtonMarkup returns the button markup for the message.
No description provided by the author
ChatInfo returns the chat info.
No description provided by the author
GetLogger returns current logger.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewInput text creates a new text input, optionally chaining with the `next` handler.
NewInputError returns an input error with msg.
No description provided by the author
No description provided by the author
NewMessage creates new Message Controller.
NewMessageText is a convenience wrapper for NewMessage with a fixed text.
NewPicklist creates a new picklist.
NewPicklistText is a convenience function to return picklist with fixed text and values.
NewPostButtons creates an instance of PostButtons.
No description provided by the author
NewSubChecker creates new subscription checker that checks the subscription on the desired channels.
NoDebugLogger switches off debug messages.
NoLogging switches off default logging, if you're brave.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PickOptBtnPattern sets the inline markup button pattern.
No description provided by the author
No description provided by the author
No description provided by the author
PickOptNoUpdate sets the No Update option.
No description provided by the author
No description provided by the author
PickOptRemoveButtons set the Remove Buttons option.
Printer returns the Message Printer for the desired lang.
PrinterContext returns the Message Printer set to the language of the sender.
PrivateOnly is the middleware that restricts the handler to only private messages.
No description provided by the author
RBOptShowPostRating enables counter of total upvotes/downvotes.
RBOptShowVoteCounter enables post rating between up/down vote buttons.
No description provided by the author
No description provided by the author
Sdump dumps the structure.
SenderInfo is the convenience function to log the sender info in the context.
SetDebugLogger sets the debug logger which is used to output debug messages, if you must.
SetLogger sets the current logger.
TextFn wraps the message in a TextFunc.
Userinfo returns the user info.
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
there has been no change to the selection.
error of this type will ask user to retry the selection or input.
tell user that there was an input error (user-error).

# Variables

BackPressed is a special type of error indicating that callback handler should call the previous handler.
No description provided by the author
ErrNoChange should be returned if the user picked the same value as before, and no update needed.
ErrRetry should be returned by CallbackFunc if the retry should be performed.

# Structs

No description provided by the author
Error is the type of error returned by the input-processing callback functions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Message is the controller that sends a message.
No description provided by the author
No description provided by the author
Rating is a struct for attaching post rating.
No description provided by the author
SubChecker is controller to check the chat subscription.

# Interfaces

Controller is the interface that some of the common controls implement.
Logger is the interface for logging.

# Type aliases

BtnCallbackFunc is being called once the user picks the value, it should return error if the value is incorrect, or ErrRetry if the retry should be performed.
No description provided by the author
ErrFunc is the error processing function.
ErrType is the type of error returned by the callback functions.
No description provided by the author
No description provided by the author
No description provided by the author
MiddlewareFunc is the function that wraps a telebot handler and returns a handler.
MsgErrFunc is the function that processes the user input.
No description provided by the author
No description provided by the author
RatingFunc is the function called by callback, given the message, user and the button index it should update the records and return the new buttons with updated values for the posting, it must maintain count of votes inhouse.
No description provided by the author
No description provided by the author
No description provided by the author
TextFunc returns formatted text, possibly personalised for user u.
ValuesFunc returns values for inline buttons, possibly personalised for user u.