slackbot

package
v0.0.0-...-d3da99e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2016 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ANNOUNCE_TIMEOUT = 30 // minutes
View Source
const APOLLO_QUOTES_FILE = "./apollo_quotes.txt"
View Source
const GOON_QUOTES_FILE = "./goon_quotes.txt"
View Source
const TALK_CHANNEL = "C0JPGPM9T" // The dumpster
View Source
const VERSION = "0.4"
View Source
const WIKI_URL = "http://wiki.apollo-community.org/index.php?title="

Variables

View Source
var COMMANDS []*Command
View Source
var FORUMS = []*Forum{
	&Forum{"Staff Applications", "https://apollo-community.org/viewforum.php?f=15", "G0JPDL06A"},
	&Forum{"Head Applications", "https://apollo-community.org/viewforum.php?f=16", "G0JPDL06A"},
	&Forum{"Race Applications", "https://apollo-community.org/viewforum.php?f=17", "G0JPDL06A"},
	&Forum{"Ban Requests", "https://apollo-community.org/viewforum.php?f=33", "G0JPDL06A"},
	&Forum{"Unban Requests", "https://apollo-community.org/viewforum.php?f=34", "G0JPDL06A"},
}
View Source
var LAST_CATFACT_TIME time.Time

Functions

This section is empty.

Types

type CatFacts

type CatFacts struct {
	Facts   []string
	Success string
}

type Command

type Command struct {
	Name string
	Desc string
	Func func(*Instance, *Message, []string) error
}

type Forum

type Forum struct {
	Title     string
	URL       string
	ChannelID string
}

type ForumTopic

type ForumTopic struct {
	Title string
	URL   string
}

type Instance

type Instance struct {
	Users    map[string]slack.User // TODO: not thread safe
	Channels map[string]slack.Channel
	Groups   map[string]slack.Group
	Latency  time.Duration
	Debug    bool
	BotId    string
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(token string, debug bool, botid string) *Instance

func (*Instance) AddScore

func (i *Instance) AddScore(amount int, score_type, user string)

func (*Instance) ChannelMsg

func (i *Instance) ChannelMsg(channel, msg string)

func (*Instance) GetScore

func (i *Instance) GetScore(score_type, user string) int

func (*Instance) HandleMsg

func (i *Instance) HandleMsg(msg *slack.MessageEvent)

func (*Instance) Mute

func (i *Instance) Mute(channel string, dur time.Duration)

func (*Instance) Run

func (i *Instance) Run()

func (*Instance) StartVote

func (i *Instance) StartVote(channel string)

func (*Instance) StopVote

func (i *Instance) StopVote(channel string) int

func (*Instance) UserMsg

func (i *Instance) UserMsg(user, msg string) error

func (*Instance) Vote

func (i *Instance) Vote(val int, channel string)

type Message

type Message struct {
	User      string
	Channel   string
	Timestamp time.Time
	Message   string
}

type Quote

type Quote struct {
	File  string
	Quote string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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