interactive

package
v1.3.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const RunCommandName = "Run command"

RunCommandName defines the button name for the run commands.

Variables

This section is empty.

Functions

func EventCommandsSection added in v0.15.0

func EventCommandsSection(cmdPrefix string, optionItems []api.OptionItem) api.Section

EventCommandsSection defines a structure of commands for a given event.

func MdHeaderFormatter

func MdHeaderFormatter(msg string) string

MdHeaderFormatter adds Markdown header formatting.

func MessageToPlaintext

func MessageToPlaintext(msg CoreMessage, newlineFormatter func(in string) string) string

MessageToPlaintext returns interactive message as a plaintext.

func NewlineFormatter

func NewlineFormatter(msg string) string

NewlineFormatter adds new line formatting.

func NoFormatting

func NoFormatting(msg string) string

NoFormatting does not apply any formatting.

func RenderMessage

func RenderMessage(mdFormatter MDFormatter, msg CoreMessage) string

RenderMessage returns interactive message as a plaintext with Markdown syntax.

Types

type CoreMessage added in v1.0.0

type CoreMessage struct {
	Header      string
	Description string
	Metadata    any
	api.Message
}

CoreMessage holds Botkube internal message model. It's useful to add Botkube specific header or description to plugin messages.

func Feedback

func Feedback() CoreMessage

Feedback generates Message structure.

type HelpMessage added in v0.15.0

type HelpMessage struct {
	// contains filtered or unexported fields
}

HelpMessage provides an option to build the Help message depending on a given platform.

func NewHelpMessage added in v0.15.0

func NewHelpMessage(platform config.CommPlatformIntegration, clusterName string, executors []string) *HelpMessage

NewHelpMessage return a new instance of HelpMessage.

func (*HelpMessage) Build added in v0.15.0

func (h *HelpMessage) Build() CoreMessage

Build returns help message with interactive sections.

type MDFormatter

type MDFormatter struct {
	// contains filtered or unexported fields
}

MDFormatter represents the capability of Markdown Formatter

func DefaultMDFormatter

func DefaultMDFormatter() MDFormatter

DefaultMDFormatter is for initializing built-in Markdown formatter

func NewMDFormatter

func NewMDFormatter(newlineFormatter, headerFormatter func(msg string) string) MDFormatter

NewMDFormatter is for initializing custom Markdown formatter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL