echo

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package echo is an reference implementation to provide the simplest form of sarah.CommandProps.

In this package two sarah.CommandPros, SlackProps and GitterProps, are exported. Developer may import this package and refer to those sarah.CommandProps to build echo command.

runner, err := sarah.NewRunner(config, sarah.WithCommandProps(echo.SlackProps), ...)

This example also shows the use of utility method called sarah.StripMessage, which strips string from given message based on given regular expression. e.g. ".echo Hey!" becomes "Hey!"

Index

Constants

This section is empty.

Variables

View Source
var GitterProps = sarah.NewCommandPropsBuilder().
	BotType(gitter.GITTER).
	Identifier(identifier).
	MatchPattern(matchPattern).
	Func(GitterCommandFunc).
	InputExample(".echo knock knock").
	MustBuild()

GitterProps is a pre-built echo command properties for Slack.

View Source
var SlackProps = sarah.NewCommandPropsBuilder().
	BotType(slack.SLACK).
	Identifier(identifier).
	MatchPattern(matchPattern).
	Func(SlackCommandFunc).
	InputExample(".echo knock knock").
	MustBuild()

SlackProps is a pre-built echo command properties for Slack.

Functions

func GitterCommandFunc

func GitterCommandFunc(_ context.Context, input sarah.Input) (*sarah.CommandResponse, error)

GitterCommandFunc is a sarah.CommandFunc especially designed for gitter adapter.

func SlackCommandFunc

func SlackCommandFunc(_ context.Context, input sarah.Input) (*sarah.CommandResponse, error)

SlackCommandFunc is a sarah.CommandFunc especially designed for Slack adapter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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