slackbot

package
v0.0.0-...-bf5f488 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SlackClient

type SlackClient struct {
	// contains filtered or unexported fields
}

the package defines a struct SlackClient that holds the slack API client, and it also defines three methods PostMessage, GetConversationHistory, and AddReaction that can be used to interact with Slack.

SlackClient is a struct that holds the slack API client

func NewSlackClient

func NewSlackClient(token string) *SlackClient

NewSlackClient creates and returns a new SlackClient

func (*SlackClient) AddReaction

func (s *SlackClient) AddReaction(emoji, messageRef string) error

AddReaction adds a reaction to a message

func (*SlackClient) DeleteMessage

func (s *SlackClient) DeleteMessage(channel, timestamp string) error

DeleteMessage delete a message in a channel

func (*SlackClient) EditMessage

func (s *SlackClient) EditMessage(channel, timestamp, message string) error

EditMessage edit a message in a channel

func (*SlackClient) GetConversationHistory

func (s *SlackClient) GetConversationHistory(channel string) ([]slack.Message, error)

GetConversationHistory returns the conversation history of a channel

func (*SlackClient) PostMessage

func (s *SlackClient) PostMessage(channel, message string) (string, string, error)

PostMessage sends a message to a channel

Jump to

Keyboard shortcuts

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