slack

package
v0.0.0-...-622823b Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(token string) (maubot.Bot, error)

Types

type Bot

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

func (*Bot) AddListener

func (bot *Bot) AddListener(listener chan maubot.Message)

AddListener adds a message listener

func (*Bot) Connect

func (bot *Bot) Connect() error

func (*Bot) Connected

func (bot *Bot) Connected() bool

Connected returns whether or not the message listener is active.

func (*Bot) Disconnect

func (bot *Bot) Disconnect() error

Disconnect stops listening for messages. It may or may not actually disconnect.

func (*Bot) SendMessage

func (bot *Bot) SendMessage(message maubot.OutgoingMessage)

SendMessage sends a message to the given channel or user.

func (*Bot) SendToListeners

func (bot *Bot) SendToListeners(message maubot.Message)

SendToListeners ...

func (*Bot) UID

func (bot *Bot) UID() string

UID returns the unique ID for this instance.

func (*Bot) Underlying

func (bot *Bot) Underlying() interface{}

Underlying returns the telebot bot object.

type Message

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

func (*Message) Reply

func (msg *Message) Reply(message string)

Reply sends a message to the room the message came from.

func (*Message) ReplyWithRef

func (msg *Message) ReplyWithRef(message string)

ReplyWithRef sends a message to the room the message came from with a reference to the original message or the sender.

func (*Message) Room

func (msg *Message) Room() string

Room returns the display name of the current channel or user.

func (*Message) RoomID

func (msg *Message) RoomID() string

RoomID returns the ID of the current channel or user.

func (*Message) Sender

func (msg *Message) Sender() string

Sender returns the preferred displayname of the sender

func (*Message) SenderID

func (msg *Message) SenderID() string

SenderID returns the ID of the sender.

func (*Message) Source

func (msg *Message) Source() maubot.Bot

Source returns the Slack parent of this message.

func (*Message) Text

func (msg *Message) Text() string

Text returns the text in the message

func (*Message) Underlying

func (msg *Message) Underlying() interface{}

Underlying returns the underlying Slack message object

Jump to

Keyboard shortcuts

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