slack

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg Config, slackOptions ...slack.Option) *Client

func (*Client) AddReaction

func (c *Client) AddReaction(receiver, messageID, reaction string) error

func (*Client) GetSelfID

func (c *Client) GetSelfID() (string, error)

func (*Client) SendMessage

func (c *Client) SendMessage(receiver, event, messageID string) (string, error)

func (*Client) ServiceBot

func (c *Client) ServiceBot(serviceHandler *service.Service) *SlackBot

type Config

type Config struct {
	SigninSecret              string   `env:"SLACK_SIGNIN_SECRET,required" json:"-"`
	ClientSecret              string   `env:"SLACK_OAUTH_TOKEN,required" json:"-"`
	Port                      uint     `env:"SLACK_SERVER_PORT" envDefault:"8080"`
	MaxConcurrentLinks        int      `env:"SLACK_MAX_CONCURRENT_LINKS" envDefault:"100"`
	MaxConcurrentMentions     int      `env:"SLACK_MAX_CONCURRENT_MENTIONS" envDefault:"100"`
	MaxConcurrentReactions    int      `env:"SLACK_MAX_CONCURRENT_REACTIONS" envDefault:"100"`
	AdminSlackUserID          []string `env:"ADMIN_SLACK_USER_IDS"`
	SlackAPIUrl               string   `env:"SLACK_API_URL"`                                  // only for testing
	DisableSecretVerification bool     `env:"DISABLE_SECRET_VERIFICATION" envDefault:"false"` // only for testing
}

type SlackBot

type SlackBot struct {
	*slack.Client
	// contains filtered or unexported fields
}

func (*SlackBot) ListenAndServe

func (s *SlackBot) ListenAndServe(ctx context.Context) error

Jump to

Keyboard shortcuts

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