util

package
v0.0.0-...-17582f3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserTimezone

func GetUserTimezone(userID string) (string, error)

GetUserTimezone gets a Slack user's timezone.

func IsInArray

func IsInArray(array []string, value string) bool

IsInArray checks if the value is in the array

func SendWelcomeMessage

func SendWelcomeMessage(teamID, userID string) error

SendWelcomeMessage sends the specified user a welcome DM.

func TransformUserReply

func TransformUserReply(reply, userID string) string

TransformUserReply transforms a user's reply

func UpdateAppHome

func UpdateAppHome(userID, teamID string) error

func VerifySlackRequest

func VerifySlackRequest(r *http.Request, body []byte) bool

VerifySlackRequest verifies a Slack request

Types

type HeaderBlock

type HeaderBlock struct {
	Type string                 `json:"type"`
	Text *slack.TextBlockObject `json:"text"`
}

HeaderBlock represents a Slack header block

func (HeaderBlock) BlockType

func (b HeaderBlock) BlockType() slack.MessageBlockType

BlockType gets the block's type

type NewInputBlock

type NewInputBlock struct {
	Type           slack.MessageBlockType `json:"type"`
	BlockID        string                 `json:"block_id,omitempty"`
	Label          *slack.TextBlockObject `json:"label"`
	Element        slack.BlockElement     `json:"element"`
	Hint           *slack.TextBlockObject `json:"hint,omitempty"`
	Optional       bool                   `json:"optional,omitempty"`
	DispatchAction bool                   `json:"dispatch_action"`
}

NewInputBlock is an input block that contains the DispatchAction field

func (NewInputBlock) BlockType

func (s NewInputBlock) BlockType() slack.MessageBlockType

Jump to

Keyboard shortcuts

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