예제 #1
0
파일: totw.go 프로젝트: plotly/slick
func (totw *Totw) InitPlugin(bot *slick.Bot) {
	slick.RegisterStringList("useless techs", []string{
		"http://i.minus.com/ib2bUNs2W1CI1V.gif",
		"http://media.giphy.com/media/anl0wydLNhKus/giphy.gif",
		"http://www.ptc.dcs.edu/Moody/comphistory/cavemanwriting.gif",
		"http://i.imgur.com/VbzhAbd.gif",
		"http://www.patrickcarrion.com/wp-content/uploads/2014/05/mowingdressgif.gif",
		"http://cdn.shopify.com/s/files/1/0243/7593/products/MKSB023_UselessMachine_Animation_grande.gif",
		"http://i.imgur.com/CRuLGek.gif",
		"http://i.imgur.com/EteBF9K.gif",
		"http://www.ohmagif.com/wp-content/uploads/2011/12/useless-invention.gif",
		"http://i3.kym-cdn.com/photos/images/original/000/495/044/9b8.gif",
		"http://uproxx.files.wordpress.com/2012/09/iron.gif",
	})
	slick.RegisterStringList("tech adept", []string{
		"you're a real tech adept",
		"what an investigator",
		"such deep search!",
		"a real innovator you are",
		"way to go, I'm impressed",
		"hope it's better than my own code",
		"noted, but are you sure it's good ?",
		"I'll take a look into this one",
		"you're generous!",
		"hurray!",
	})

	totw.bot = bot

	go totw.ScheduleAlerts(bot.Config.GeneralChannel, time.Thursday, 16, 0)

	bot.ListenFor(&slick.Conversation{
		HandlerFunc: totw.ChatHandler,
	})
}
예제 #2
0
파일: vote.go 프로젝트: plotly/slick
func (vote *Vote) InitPlugin(bot *slick.Bot) {
	vote.bot = bot

	bot.ListenFor(&slick.Conversation{
		PublicOnly:  true,
		HandlerFunc: vote.voteHandler,
	})
}
예제 #3
0
파일: standup.go 프로젝트: plotly/slick
func (standup *Standup) InitPlugin(bot *slick.Bot) {
	standup.bot = bot
	standup.sectionUpdates = make(chan sectionUpdate, 15)

	go standup.manageUpdatesInteraction()

	bot.ListenFor(&slick.Conversation{
		HandlerFunc: standup.ChatHandler,
	})
}
예제 #4
0
파일: plotberry.go 프로젝트: plotly/slick
func (plotberry *PlotBerry) InitPlugin(bot *slick.Bot) {

	plotberry.bot = bot
	plotberry.celebrated = true
	plotberry.pingTime = 10 * time.Second
	plotberry.totalUsers = 100001

	statchan := make(chan TotalUsers, 100)

	go plotberry.launchWatcher(statchan)
	go plotberry.launchCounter(statchan)

	bot.ListenFor(&slick.Conversation{
		HandlerFunc: plotberry.ChatHandler,
	})
}
예제 #5
0
파일: healthy.go 프로젝트: plotly/slick
func (healthy *Healthy) InitPlugin(bot *slick.Bot) {
	var conf struct {
		HealthCheck struct {
			Urls []string
		}
	}

	bot.LoadConfig(&conf)

	healthy.urls = conf.HealthCheck.Urls

	bot.ListenFor(&slick.Conversation{
		MentionsMeOnly: true,
		ContainsAny:    []string{"health", "healthy?", "health_check"},
		HandlerFunc:    healthy.ChatHandler,
	})
}
예제 #6
0
파일: wicked.go 프로젝트: plotly/slick
func (wicked *Wicked) InitPlugin(bot *slick.Bot) {
	wicked.bot = bot
	wicked.meetings = make(map[string]*Meeting)

	var conf struct {
		Wicked struct {
			Confrooms []string `json:"conf_rooms"`
		}
	}
	bot.LoadConfig(&conf)
	for _, confroom := range conf.Wicked.Confrooms {
		wicked.confRooms = append(wicked.confRooms, confroom)
	}

	bot.ListenFor(&slick.Conversation{
		HandlerFunc: wicked.ChatHandler,
	})
}
예제 #7
0
파일: bugger.go 프로젝트: plotly/slick
func (bugger *Bugger) InitPlugin(bot *slick.Bot) {

	/*
	 * Get an array of issues matching Filters
	 */
	bugger.bot = bot

	var conf struct {
		Github github.Conf
	}

	bot.LoadConfig(&conf)

	bugger.ghclient = github.Client{
		Conf: conf.Github,
	}

	bot.ListenFor(&slick.Conversation{
		HandlerFunc: bugger.ChatHandler,
	})

}
예제 #8
0
파일: deployer.go 프로젝트: plotly/slick
func (dep *Deployer) InitPlugin(bot *slick.Bot) {
	var conf struct {
		Deployer DeployerConfig
	}
	bot.LoadConfig(&conf)

	dep.bot = bot
	dep.pubsub = pubsub.New(100)
	dep.config = &conf.Deployer
	dep.env = os.Getenv("PLOTLY_ENV")

	if dep.env == "" {
		dep.env = "debug"
	}

	dep.loadInternalAPI()

	go dep.pubsubForwardReply()

	bot.ListenFor(&slick.Conversation{
		HandlerFunc:    dep.ChatHandler,
		MentionsMeOnly: true,
	})
}