slack

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package slack is a package meant to help utilize the Slack API in GitHub actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindChannelID

func FindChannelID(channels []slack.Channel, name string) (string, error)

FindChannelID given a channel name, finds the channel id.

func GetAllChannels

func GetAllChannels(client *slack.Client) ([]slack.Channel, error)

GetAllChannels retrieves a list of all the available slack channels and retries once if needed.

func Hyperlink(text, link string) string

Hyperlink returns a hyperlink that be used in a slack message sent via the API.

func JoinConversationContext added in v1.5.0

func JoinConversationContext(ctx context.Context, client *slack.Client, channelID string) error

JoinConversationContext joins the specified slack channel and retries once if needed.

func Message

func Message(text string) slack.MsgOption

Message returns a message able to be posted via slack.*Client.PostMessage[Context].

func NewClient

func NewClient() (*slack.Client, error)

NewClient returns a new slack client configured with the token we expect to exist in the environment.

func PostMessageContext added in v1.5.0

func PostMessageContext(ctx context.Context, client *slack.Client, channelID, message string) error

PostMessageContext posts a message to the specified channel and retries if needed. Before trying to post, you need to make sure that you are part of channel by using JoinConversationContext.

Types

This section is empty.

Jump to

Keyboard shortcuts

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