slack

package
v0.0.0-...-71bc1bf Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 3 Imported by: 12

Documentation

Overview

Package slack implements Slack handlers for github.com/go-chat-bot/bot

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddReactionToMessage

func AddReactionToMessage(msgid, channel string, reaction string) error

AddReactionToMessage allows you to add a reaction, to a message.

func FindUserBySlackID

func FindUserBySlackID(userID string) *bot.User

FindUserBySlackID converts a slack.User into a bot.User struct

func RemoveReactionFromMessage

func RemoveReactionFromMessage(msgid, channel string, reaction string) error

RemoveReactionFromMessage allows you to remove a reaction, from a message.

func Run

func Run(token string)

Run connects to slack RTM API using the provided token

func RunWithFilter

func RunWithFilter(token string, customMessageFilter MessageFilter)

RunWithFilter executes the bot and sets up a message filter which will receive all the messages before they are sent to slack

Types

type MessageFilter

type MessageFilter func(string, *bot.User) (string, slack.PostMessageParameters)

MessageFilter allows implementing a filter function to transform the messages before sending to the channel, it is run before the bot sends the message to slack

Jump to

Keyboard shortcuts

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