Documentation ¶
Index ¶
- Constants
- func EventCommandsSection(cmdPrefix string, optionItems []api.OptionItem) api.Section
- func MdHeaderFormatter(msg string) string
- func MessageToPlaintext(msg CoreMessage, newlineFormatter func(in string) string) string
- func NewlineFormatter(msg string) string
- func NoFormatting(msg string) string
- func RenderMessage(mdFormatter MDFormatter, msg CoreMessage) string
- type CoreMessage
- type HelpMessage
- type MDFormatter
Constants ¶
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 ¶
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 ¶
NewlineFormatter adds new line formatting.
func NoFormatting ¶
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
CoreMessage holds Botkube internal message model. It's useful to add Botkube specific header or description to plugin messages.
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