2012-08-17 23:22:37 +00:00
|
|
|
package plugins
|
|
|
|
|
2012-08-18 01:39:26 +00:00
|
|
|
import (
|
2012-12-01 23:01:03 +00:00
|
|
|
"encoding/json"
|
2012-12-01 23:58:21 +00:00
|
|
|
"errors"
|
2012-08-18 01:39:26 +00:00
|
|
|
"fmt"
|
2013-05-08 00:08:18 +00:00
|
|
|
"github.com/chrissexton/alepale/bot"
|
2012-12-01 23:01:03 +00:00
|
|
|
"io/ioutil"
|
2012-08-18 02:30:04 +00:00
|
|
|
"labix.org/v2/mgo"
|
|
|
|
"labix.org/v2/mgo/bson"
|
2012-12-01 23:01:03 +00:00
|
|
|
"log"
|
2012-08-25 04:49:48 +00:00
|
|
|
"math/rand"
|
2012-12-01 23:01:03 +00:00
|
|
|
"net/http"
|
2012-08-18 01:39:26 +00:00
|
|
|
"strconv"
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
)
|
2012-08-17 23:22:37 +00:00
|
|
|
|
|
|
|
// This is a skeleton plugin to serve as an example and quick copy/paste for new plugins.
|
|
|
|
|
|
|
|
type BeersPlugin struct {
|
2012-08-18 02:30:04 +00:00
|
|
|
Bot *bot.Bot
|
|
|
|
Coll *mgo.Collection
|
2012-08-17 23:22:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewBeersPlugin creates a new BeersPlugin with the Plugin interface
|
|
|
|
func NewBeersPlugin(bot *bot.Bot) *BeersPlugin {
|
2012-08-18 02:30:04 +00:00
|
|
|
p := BeersPlugin{
|
2012-08-17 23:22:37 +00:00
|
|
|
Bot: bot,
|
|
|
|
}
|
2012-08-18 02:30:04 +00:00
|
|
|
p.LoadData()
|
2013-09-01 02:24:46 +00:00
|
|
|
for _, channel := range bot.Config.UntappdChannels {
|
2013-08-31 04:24:55 +00:00
|
|
|
go p.untappdLoop(channel)
|
2012-12-01 23:01:03 +00:00
|
|
|
}
|
2012-08-18 02:30:04 +00:00
|
|
|
return &p
|
2012-08-17 23:22:37 +00:00
|
|
|
}
|
|
|
|
|
2012-08-18 02:30:04 +00:00
|
|
|
type userBeers struct {
|
2012-08-18 01:39:26 +00:00
|
|
|
Nick string
|
2012-08-18 02:30:04 +00:00
|
|
|
Beercount int
|
|
|
|
Lastdrunk time.Time
|
|
|
|
Momentum float64
|
|
|
|
New bool
|
|
|
|
}
|
|
|
|
|
|
|
|
func (u *userBeers) Save(coll *mgo.Collection) {
|
|
|
|
_, err := coll.Upsert(bson.M{"nick": u.Nick}, u)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func getUserBeers(coll *mgo.Collection, nick string) *userBeers {
|
|
|
|
ub := userBeers{New: true}
|
2012-08-25 01:43:53 +00:00
|
|
|
coll.Find(bson.M{"nick": nick}).One(&ub)
|
2012-08-18 02:30:04 +00:00
|
|
|
if ub.New == true {
|
|
|
|
ub.New = false
|
2012-08-25 01:43:53 +00:00
|
|
|
ub.Nick = nick
|
|
|
|
ub.Beercount = 0
|
|
|
|
ub.Momentum = 0
|
2012-08-18 02:30:04 +00:00
|
|
|
ub.Save(coll)
|
|
|
|
}
|
|
|
|
return &ub
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
2012-08-17 23:22:37 +00:00
|
|
|
// Message responds to the bot hook on recieving messages.
|
|
|
|
// This function returns true if the plugin responds in a meaningful way to the users message.
|
|
|
|
// Otherwise, the function returns false and the bot continues execution of other plugins.
|
|
|
|
func (p *BeersPlugin) Message(message bot.Message) bool {
|
2012-08-18 01:39:26 +00:00
|
|
|
parts := strings.Fields(message.Body)
|
|
|
|
|
|
|
|
if len(parts) == 0 {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
channel := message.Channel
|
|
|
|
user := message.User
|
|
|
|
nick := user.Name
|
|
|
|
|
|
|
|
// respond to the beers type of queries
|
2012-08-26 00:11:31 +00:00
|
|
|
parts[0] = strings.ToLower(parts[0]) // support iPhone/Android saying "Beers"
|
2012-08-18 01:39:26 +00:00
|
|
|
if parts[0] == "beers" {
|
|
|
|
if len(parts) == 3 {
|
|
|
|
|
|
|
|
// try to get a count out of parts[2]
|
|
|
|
count, err := strconv.Atoi(parts[2])
|
|
|
|
if err != nil {
|
|
|
|
// if it's not a number, maybe it's a nick!
|
2012-08-18 02:53:39 +00:00
|
|
|
p.Bot.SendMessage(channel, "Sorry, that didn't make any sense.")
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if count < 0 {
|
|
|
|
// you can't be negative
|
|
|
|
msg := fmt.Sprintf("Sorry %s, you can't have negative beers!", nick)
|
|
|
|
p.Bot.SendMessage(channel, msg)
|
|
|
|
}
|
|
|
|
if parts[1] == "+=" {
|
2012-12-01 23:01:03 +00:00
|
|
|
p.setBeers(nick, p.getBeers(nick)+count)
|
2012-08-25 01:52:15 +00:00
|
|
|
p.randomReply(channel)
|
2012-08-18 01:39:26 +00:00
|
|
|
} else if parts[1] == "=" {
|
|
|
|
if count == 0 {
|
2012-12-01 23:01:03 +00:00
|
|
|
p.puke(nick, channel)
|
2012-08-18 01:39:26 +00:00
|
|
|
} else {
|
2012-12-01 23:01:03 +00:00
|
|
|
p.setBeers(nick, count)
|
2012-08-25 01:52:15 +00:00
|
|
|
p.randomReply(channel)
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
p.Bot.SendMessage(channel, "I don't know your math.")
|
|
|
|
}
|
2012-08-18 02:53:39 +00:00
|
|
|
} else if len(parts) == 2 {
|
|
|
|
if p.doIKnow(parts[1]) {
|
|
|
|
p.reportCount(parts[1], channel, false)
|
|
|
|
} else {
|
|
|
|
msg := fmt.Sprintf("Sorry, I don't know %s.", parts[1])
|
|
|
|
p.Bot.SendMessage(channel, msg)
|
|
|
|
}
|
2012-08-18 02:30:04 +00:00
|
|
|
} else if len(parts) == 1 {
|
|
|
|
p.reportCount(nick, channel, true)
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// no matter what, if we're in here, then we've responded
|
|
|
|
return true
|
2013-01-22 17:36:43 +00:00
|
|
|
} else if parts[0] == "beers--" {
|
2013-01-22 17:39:27 +00:00
|
|
|
p.setBeers(nick, p.getBeers(nick)-1)
|
2013-01-22 17:36:43 +00:00
|
|
|
p.Bot.SendAction(channel, "flushes")
|
|
|
|
return true
|
2012-08-18 02:30:04 +00:00
|
|
|
} else if parts[0] == "beers++" {
|
2012-12-01 23:01:03 +00:00
|
|
|
p.addBeers(nick)
|
2012-08-25 01:52:15 +00:00
|
|
|
p.randomReply(channel)
|
2012-08-18 02:30:04 +00:00
|
|
|
return true
|
2012-12-09 00:42:10 +00:00
|
|
|
} else if parts[0] == "bourbon++" {
|
2012-12-09 00:43:50 +00:00
|
|
|
p.addBeers(nick)
|
|
|
|
p.addBeers(nick)
|
2012-12-09 00:42:10 +00:00
|
|
|
p.randomReply(channel)
|
|
|
|
return true
|
2012-08-18 02:30:04 +00:00
|
|
|
} else if parts[0] == "puke" {
|
2012-12-01 23:01:03 +00:00
|
|
|
p.puke(nick, channel)
|
2012-08-18 02:30:04 +00:00
|
|
|
return true
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if message.Command && parts[0] == "imbibe" {
|
2012-12-01 23:01:03 +00:00
|
|
|
p.addBeers(nick)
|
2012-08-25 01:52:15 +00:00
|
|
|
p.randomReply(channel)
|
2012-08-18 01:39:26 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2012-12-01 23:01:03 +00:00
|
|
|
if message.Command && parts[0] == "reguntappd" {
|
2013-08-31 19:58:15 +00:00
|
|
|
chanNick := message.User.Name
|
|
|
|
channel := message.Channel
|
|
|
|
|
2012-12-01 23:01:03 +00:00
|
|
|
if len(parts) < 2 {
|
|
|
|
p.Bot.SendMessage(channel, "You must also provide a user name.")
|
2013-08-31 19:58:15 +00:00
|
|
|
} else if len(parts) == 3 {
|
|
|
|
chanNick = parts[2]
|
|
|
|
} else if len(parts) == 4 {
|
|
|
|
chanNick = parts[2]
|
|
|
|
channel = parts[3]
|
2012-12-01 23:01:03 +00:00
|
|
|
}
|
|
|
|
u := untappdUser{
|
|
|
|
UntappdUser: parts[1],
|
2013-08-31 19:58:15 +00:00
|
|
|
ChanNick: chanNick,
|
|
|
|
Channel: channel,
|
2012-12-01 23:01:03 +00:00
|
|
|
}
|
|
|
|
|
2013-08-31 19:58:15 +00:00
|
|
|
log.Println("Creating Untappd user:", u.UntappdUser, "nick:", u.ChanNick)
|
2013-08-31 04:11:54 +00:00
|
|
|
|
2013-08-31 19:58:15 +00:00
|
|
|
_, err := p.Coll.Upsert(bson.M{"untappduser": u.UntappdUser}, u)
|
|
|
|
if err != nil {
|
|
|
|
log.Println("ERROR!!!:", err)
|
|
|
|
}
|
2012-12-01 23:58:21 +00:00
|
|
|
|
2012-12-01 23:01:03 +00:00
|
|
|
p.Bot.SendMessage(channel, "I'll be watching you.")
|
2013-08-31 19:58:15 +00:00
|
|
|
|
|
|
|
p.checkUntappd(channel)
|
|
|
|
|
2012-12-01 23:01:03 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
if message.Command && parts[0] == "checkuntappd" {
|
|
|
|
p.checkUntappd(channel)
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2012-08-17 23:22:37 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2012-08-25 04:46:13 +00:00
|
|
|
// Empty event handler because this plugin does not do anything on event recv
|
2012-08-25 04:49:48 +00:00
|
|
|
func (p *BeersPlugin) Event(kind string, message bot.Message) bool {
|
2012-08-25 04:46:13 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2012-08-17 23:22:37 +00:00
|
|
|
// LoadData imports any configuration data into the plugin. This is not strictly necessary other
|
|
|
|
// than the fact that the Plugin interface demands it exist. This may be deprecated at a later
|
|
|
|
// date.
|
|
|
|
func (p *BeersPlugin) LoadData() {
|
2012-08-18 02:30:04 +00:00
|
|
|
p.Coll = p.Bot.Db.C("beers")
|
2012-08-25 01:52:15 +00:00
|
|
|
rand.Seed(time.Now().Unix())
|
2012-08-17 23:22:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Help responds to help requests. Every plugin must implement a help function.
|
|
|
|
func (p *BeersPlugin) Help(channel string, parts []string) {
|
2012-08-18 03:11:36 +00:00
|
|
|
msg := "Beers: imbibe by using either beers +=,=,++ or with the !imbibe/drink " +
|
|
|
|
"commands. I'll keep a count of how many beers you've had and then if you want " +
|
|
|
|
"to reset, just !puke it all up!"
|
|
|
|
p.Bot.SendMessage(channel, msg)
|
2012-08-17 23:22:37 +00:00
|
|
|
}
|
2012-08-18 01:39:26 +00:00
|
|
|
|
2012-12-01 23:01:03 +00:00
|
|
|
func (p *BeersPlugin) setBeers(user string, amount int) {
|
|
|
|
ub := getUserBeers(p.Coll, user)
|
2012-08-18 02:30:04 +00:00
|
|
|
ub.Beercount = amount
|
2012-08-25 01:43:53 +00:00
|
|
|
ub.Lastdrunk = time.Now()
|
2012-08-18 02:30:04 +00:00
|
|
|
ub.Save(p.Coll)
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
2012-12-01 23:01:03 +00:00
|
|
|
func (p *BeersPlugin) addBeers(user string) {
|
|
|
|
p.setBeers(user, p.getBeers(user)+1)
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
2012-08-18 02:30:04 +00:00
|
|
|
func (p *BeersPlugin) getBeers(nick string) int {
|
|
|
|
ub := getUserBeers(p.Coll, nick)
|
2012-08-18 01:39:26 +00:00
|
|
|
|
2012-08-18 02:30:04 +00:00
|
|
|
return ub.Beercount
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
2012-08-18 02:30:04 +00:00
|
|
|
func (p *BeersPlugin) reportCount(nick, channel string, himself bool) {
|
|
|
|
beers := p.getBeers(nick)
|
|
|
|
msg := fmt.Sprintf("%s has had %d beers so far.", nick, beers)
|
|
|
|
if himself {
|
2012-08-18 02:53:39 +00:00
|
|
|
if beers == 0 {
|
|
|
|
msg = fmt.Sprintf("You really need to get drinkin, %s!", nick)
|
|
|
|
} else {
|
|
|
|
msg = fmt.Sprintf("You've had %d beers so far, %s.", beers, nick)
|
|
|
|
}
|
2012-08-18 02:30:04 +00:00
|
|
|
}
|
|
|
|
p.Bot.SendMessage(channel, msg)
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
2012-12-01 23:01:03 +00:00
|
|
|
func (p *BeersPlugin) puke(user string, channel string) {
|
2012-08-18 02:30:04 +00:00
|
|
|
p.setBeers(user, 0)
|
2012-12-01 23:01:03 +00:00
|
|
|
msg := fmt.Sprintf("Ohhhhhh, and a reversal of fortune for %s!", user)
|
2012-08-18 02:30:04 +00:00
|
|
|
p.Bot.SendMessage(channel, msg)
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
|
|
|
|
2012-08-18 02:30:04 +00:00
|
|
|
func (p *BeersPlugin) doIKnow(nick string) bool {
|
|
|
|
count, err := p.Coll.Find(bson.M{"nick": nick}).Count()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return count > 0
|
2012-08-18 01:39:26 +00:00
|
|
|
}
|
2012-08-25 01:52:15 +00:00
|
|
|
|
|
|
|
// Sends random affirmation to the channel. This could be better (with a datastore for sayings)
|
|
|
|
func (p *BeersPlugin) randomReply(channel string) {
|
|
|
|
replies := []string{"ZIGGY! ZAGGY!", "HIC!", "Stay thirsty, my friend!"}
|
|
|
|
p.Bot.SendMessage(channel, replies[rand.Intn(len(replies))])
|
2012-08-25 04:49:48 +00:00
|
|
|
}
|
2012-12-01 23:01:03 +00:00
|
|
|
|
|
|
|
type checkin struct {
|
|
|
|
Checkin_id int
|
|
|
|
Created_at string
|
|
|
|
Checkin_comment string
|
2013-01-19 21:42:05 +00:00
|
|
|
// Rating_score int // Apparently Untappd makes this a string when not present. :(
|
|
|
|
Beer map[string]interface{}
|
|
|
|
Brewery map[string]interface{}
|
|
|
|
Venue interface{}
|
2013-08-31 04:11:54 +00:00
|
|
|
User mrUntappd
|
|
|
|
}
|
|
|
|
|
|
|
|
type mrUntappd struct {
|
|
|
|
Uid int
|
|
|
|
User_name string
|
|
|
|
Relationship string
|
2012-12-01 23:01:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type checkins struct {
|
|
|
|
Count int
|
|
|
|
Items []checkin
|
|
|
|
}
|
|
|
|
|
|
|
|
type resp struct {
|
|
|
|
Checkins checkins
|
|
|
|
}
|
|
|
|
|
|
|
|
type Beers struct {
|
|
|
|
Response resp
|
|
|
|
}
|
|
|
|
|
|
|
|
type untappdUser struct {
|
2013-08-31 19:58:15 +00:00
|
|
|
Id bson.ObjectId `bson:"_id,omitempty"`
|
2012-12-01 23:58:21 +00:00
|
|
|
UntappdUser string
|
2013-06-16 15:52:47 +00:00
|
|
|
Channel string
|
2012-12-01 23:58:21 +00:00
|
|
|
LastCheckin int
|
|
|
|
ChanNick string
|
|
|
|
KnownCheckins [5]int
|
|
|
|
}
|
|
|
|
|
2013-08-31 19:58:15 +00:00
|
|
|
func (p *BeersPlugin) pullUntappd() ([]checkin, error) {
|
2012-12-01 23:58:21 +00:00
|
|
|
access_token := "?access_token=" + p.Bot.Config.UntappdToken
|
2013-08-31 04:11:54 +00:00
|
|
|
baseUrl := "http://api.untappd.com/v4/checkin/recent/"
|
2012-12-01 23:58:21 +00:00
|
|
|
|
2013-08-31 04:11:54 +00:00
|
|
|
url := baseUrl + access_token + "&limit=25"
|
2012-12-01 23:58:21 +00:00
|
|
|
log.Println("Request:", url)
|
|
|
|
|
|
|
|
resp, err := http.Get(url)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
if resp.StatusCode == 500 {
|
2013-08-31 19:58:15 +00:00
|
|
|
return []checkin{}, errors.New(resp.Status)
|
2012-12-01 23:58:21 +00:00
|
|
|
}
|
|
|
|
body, err := ioutil.ReadAll(resp.Body)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
var beers Beers
|
|
|
|
err = json.Unmarshal(body, &beers)
|
|
|
|
if err != nil {
|
2013-08-31 04:11:54 +00:00
|
|
|
log.Println(err)
|
2013-08-31 19:58:15 +00:00
|
|
|
return []checkin{}, errors.New("Unable to parse JSON")
|
2012-12-01 23:58:21 +00:00
|
|
|
}
|
2013-08-31 19:58:15 +00:00
|
|
|
return beers.Response.Checkins.Items, nil
|
2012-12-01 23:01:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *BeersPlugin) checkUntappd(channel string) {
|
|
|
|
if p.Bot.Config.UntappdToken == "<Your Token>" {
|
|
|
|
log.Println("No Untappd token, cannot enable plugin.")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-08-31 04:11:54 +00:00
|
|
|
var users []untappdUser
|
|
|
|
p.Coll.Find(bson.M{"untappduser": bson.M{"$exists": true}, "channel": channel}).All(&users)
|
2012-12-01 23:01:03 +00:00
|
|
|
|
2013-08-31 04:11:54 +00:00
|
|
|
log.Println("Found ", len(users), " untappd users")
|
2012-12-01 23:01:03 +00:00
|
|
|
|
2013-08-31 04:11:54 +00:00
|
|
|
userMap := make(map[string]untappdUser)
|
|
|
|
for _, u := range users {
|
|
|
|
userMap[u.UntappdUser] = u
|
|
|
|
}
|
2012-12-02 00:00:51 +00:00
|
|
|
|
2013-08-31 19:58:15 +00:00
|
|
|
chks, err := p.pullUntappd()
|
|
|
|
for i := len(chks); i > 0; i-- {
|
|
|
|
checkin := chks[i-1]
|
|
|
|
|
2013-08-31 04:11:54 +00:00
|
|
|
if err != nil {
|
2013-08-31 19:58:15 +00:00
|
|
|
log.Println("ERROR!:", err)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
if checkin.Checkin_id <= userMap[checkin.User.User_name].LastCheckin {
|
2013-08-31 04:11:54 +00:00
|
|
|
continue
|
|
|
|
}
|
2012-12-01 23:01:03 +00:00
|
|
|
|
2013-08-31 04:11:54 +00:00
|
|
|
venue := ""
|
|
|
|
switch v := checkin.Venue.(type) {
|
|
|
|
case map[string]interface{}:
|
|
|
|
venue = " at " + v["venue_name"].(string)
|
|
|
|
}
|
|
|
|
beerName := checkin.Beer["beer_name"].(string)
|
|
|
|
breweryName := checkin.Brewery["brewery_name"].(string)
|
|
|
|
user, ok := userMap[checkin.User.User_name]
|
|
|
|
if !ok {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
p.addBeers(user.ChanNick)
|
|
|
|
drunken := p.getBeers(user.ChanNick)
|
|
|
|
|
|
|
|
msg := fmt.Sprintf("%s just drank %s by %s%s, bringing his drunkeness to %d",
|
|
|
|
user.ChanNick, beerName, breweryName, venue, drunken)
|
|
|
|
if checkin.Checkin_comment != "" {
|
|
|
|
msg = fmt.Sprintf("%s -- %s",
|
|
|
|
msg, checkin.Checkin_comment)
|
|
|
|
}
|
2012-12-01 23:01:03 +00:00
|
|
|
|
2013-08-31 19:58:15 +00:00
|
|
|
user.LastCheckin = checkin.Checkin_id
|
|
|
|
err := p.Coll.Update(bson.M{"_id": user.Id}, user)
|
|
|
|
if err != nil {
|
|
|
|
log.Println("UPDATE ERROR!:", err)
|
|
|
|
}
|
2012-12-01 23:01:03 +00:00
|
|
|
|
2013-08-31 19:58:15 +00:00
|
|
|
log.Println("checkin id:", checkin.Checkin_id, "Message:", msg)
|
2013-08-31 04:11:54 +00:00
|
|
|
p.Bot.SendMessage(channel, msg)
|
|
|
|
}
|
|
|
|
}
|
2012-12-01 23:01:03 +00:00
|
|
|
|
2013-08-31 04:11:54 +00:00
|
|
|
func (p *BeersPlugin) untappdLoop(channel string) {
|
|
|
|
frequency := p.Bot.Config.UntappdFreq
|
2012-12-01 23:01:03 +00:00
|
|
|
|
2013-08-31 19:58:15 +00:00
|
|
|
log.Println("Checking every ", frequency, " seconds")
|
|
|
|
|
2013-08-31 04:11:54 +00:00
|
|
|
for {
|
|
|
|
time.Sleep(time.Duration(frequency) * time.Second)
|
|
|
|
p.checkUntappd(channel)
|
2012-12-01 23:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
2013-05-08 00:08:18 +00:00
|
|
|
|
|
|
|
// Handler for bot's own messages
|
|
|
|
func (p *BeersPlugin) BotMessage(message bot.Message) bool {
|
|
|
|
return false
|
|
|
|
}
|
2013-06-01 17:10:15 +00:00
|
|
|
|
|
|
|
// Register any web URLs desired
|
|
|
|
func (p *BeersPlugin) RegisterWeb() *string {
|
|
|
|
return nil
|
|
|
|
}
|