slack

package module
v0.0.0-...-5a194fd Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Slack *slackClient.Client
	// contains filtered or unexported fields
}

Client is a slack client

func New

func New(token string, logger *logrus.Logger) *Client

New returns a webhook client

func (*Client) GetSlackChannelID

func (c *Client) GetSlackChannelID(email string) (string, error)

GetSlackChannelID returns the chanel id from an email

func (*Client) PostMessage

func (c *Client) PostMessage(message Message) error

PostMessage is DEPRECATED

func (*Client) SendMessageToUser

func (c *Client) SendMessageToUser(userID, message string) error

SendMessageToUser will send the given text to the specified userID.

func (*Client) SendMessageToUserByEmail

func (c *Client) SendMessageToUserByEmail(email, message string, attachments []slackClient.Attachment) error

SendMessageToUserByEmail posts a message

type Message

type Message struct {
	Text        string `json:"text,omitempty"`
	Email       string
	Attachments []slackClient.Attachment
}

Message is a slack message

Jump to

Keyboard shortcuts

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