slack

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetLogger() log.Logger
	GetCommandSet() *command.CommandSet
	GetSlackToken() string
	GetMaxRunningCommands() int
}

type SlackEngine

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

SlackEngine is a client for Slack.

func (*SlackEngine) Close

func (e *SlackEngine) Close(errCode int)

Close closes the engine.

func (*SlackEngine) FileUpload

func (e *SlackEngine) FileUpload(channel string, file io.Reader, filename string) error

FileUpload uploads file.

func (*SlackEngine) FileUploadWithType

func (e *SlackEngine) FileUploadWithType(channel string, file io.Reader, filename, filetype string) error

FileUploadWithType uploads file with file type. erf: https://api.slack.com/types/file#file_types

func (*SlackEngine) GetEmojiByRandom

func (e *SlackEngine) GetEmojiByRandom() (string, error)

GetEmojiByRandom gets emoji randomly.

func (*SlackEngine) GetUserByID

func (e *SlackEngine) GetUserByID(userID string) (engine.User, error)

GetUserByID gets user by given userID.

func (*SlackEngine) Init

func (e *SlackEngine) Init(conf engine.Config) error

Init initializes slack engine with Config.

func (*SlackEngine) KeepAlive

func (e *SlackEngine) KeepAlive()

KeepAlive keeps the connection in case of disconnection for long-running process.

func (*SlackEngine) ReactEmoji

func (e *SlackEngine) ReactEmoji(channel, emoji, msgTimestamp string) error

ReactEmoji adds reaction emoji to a message.

func (*SlackEngine) Reload

func (e *SlackEngine) Reload()

Reload reloads the engine.

func (*SlackEngine) Reply

func (e *SlackEngine) Reply(channel, text string) error

ReplyThread sends a message in the channel.

func (*SlackEngine) ReplyThread

func (e *SlackEngine) ReplyThread(channel, text, threadTimestamp string) error

ReplyThread sends a message in the thread of threadTimestamp.

func (*SlackEngine) Run

func (e *SlackEngine) Run() int

Run the SlackBot main logic loop.

type SlackLogger

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

func (SlackLogger) Output

func (l SlackLogger) Output(_ int, s string) error

Jump to

Keyboard shortcuts

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