Documentation ¶
Overview ¶
Package menu implements functionality of a telegram menu.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RootViewCallback = "/" CreateButtonCallback = "/create" ShapesViewCallback = "/shape" ShapesButtonCallback = fmt.Sprintf("%s/([0-8])", ShapesViewCallback) IterViewCallback = "/iter" IterButtonCallback = fmt.Sprintf("%s/([0-9]+)", IterViewCallback) IterInputCallback = "/iter/input" RepViewCallback = "/rep" RepButtonCallback = fmt.Sprintf("%s/([1-6])", RepViewCallback) AlphaViewCallback = "/alpha" AlphaButtonCallback = fmt.Sprintf("%s/([0-9]+)", AlphaViewCallback) AlphaInputCallback = "/alpha/input" ExtViewCallback = "/ext" ExtButtonCallback = fmt.Sprintf("%s/(jpg|png|svg|gif)", ExtViewCallback) SizeViewCallback = "/size" SizeButtonCallback = fmt.Sprintf("%s/([0-9]+)", SizeViewCallback) SizeInputCallback = "/size/input" )
Callbacks that are sent by menu buttons.
View Source
var (
OtherButtonText string
)
Text of buttons in the menu.
View Source
var ShapeNames map[primitive.Shape]string
ShapeNames contains mapping of shapes to their string representation.
Functions ¶
Types ¶
type Menu ¶
type Menu struct { RootView View ShapesView View IterView View RepView View AlphaView View ExtView View SizeView View }
Menu represents menu made of View instances.
type View ¶
type View struct { Text string Keyboard tg.InlineKeyboardMarkup }
View represents menu 'window' that is made with the telegram's inline keyboard.
var ( RootViewTmpl View ShapesViewTmpl View IterViewTmpl View RepViewTmpl View AlphaViewTmpl View ExtViewTmpl View SizeViewTmpl View )
Templates for the different menu views.
func NewMenuView ¶
NewMenuView creates new View from the template. The second parameter specifies callback of the option that is selected in the moment. Selected option will be marked with the special symbol. Optional parameter allows to specify new text for the button.
Click to show internal directories.
Click to hide internal directories.