mcdowell

package module
v0.0.0-...-a854f13 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: MIT Imports: 6 Imported by: 0

README

McDowell

Build Status

Cleo McDowell

This is a Slack bot for the Atlanta Black Tech Slack.

You can get an invite from here

Building

This bot requires Go 1.7+ and can be built as follows:

    go build ./cmd/mcdowell

Running

To run this you need to set the the following environment variables:

  • ABT_SLACK_BOT_TOKEN - the Slack bot token
  • ABT_SLACK_BOT_DEV_MODE - boolean, set the bot in development mode
    ABT_SLACK_BOT_TOKEN=<TOKEN_HERE> ./mcdowell

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Versioned

func Versioned(version string) func(*Bot)

Versioned enables Version to be set on the bot.

func WithDebug

func WithDebug() func(*Bot)

WithDebug enables debug mode on the bot.

func WithTesting

func WithTesting() func(*Bot)

WithTesting enables test mode on the bot.

Types

type Bot

type Bot struct {
	Debug   bool
	Testing bool
	Version string
	// contains filtered or unexported fields
}

Bot represents a single bot instance.

func NewBot

func NewBot(ctx context.Context, client SlackClient, options ...func(*Bot)) (*Bot, error)

NewBot returns a new McDowell Bot instance ready to handle any events from Slack.

func (*Bot) OnNewMessage

func (b *Bot) OnNewMessage(event *slack.MessageEvent) error

OnNewMessage handles the appropriate behavior for when new interesting messages happen in any channel the bot is listening in.

func (*Bot) OnTeamJoined

func (b *Bot) OnTeamJoined(event *slack.TeamJoinEvent) error

OnTeamJoined handles the appropriate behavior for when new team members join our slack.

type SlackClient

type SlackClient interface {
	PostMessage(channel, message string, params slack.PostMessageParameters) (string, string, error)
	GetUsers() ([]slack.User, error)
}

SlackClient represents the interface of methods we rely on from the Slack client.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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