Exemple #1
0
func Register(b *bot.Bot) {
	if len(*chans) == 0 {
		log.Printf("skipping paste init: no channels to notify")
		return
	}

	b.OnConnect(addServer)
	b.OnDisconnect(delServer)

	go pasteloop()
}
Exemple #2
0
func Register(b *bot.Bot) {
	if len(*chans) == 0 {
		log.Printf("skipping paste init: no channels to notify")
	}

	b.OnConnect(addServer)
	b.OnDisconnect(delServer)

	url, err := url.Parse(*psrvurl)
	if err != nil {
		log.Fatalf("paste: bad url %q: %s", *psrvurl, err)
	}

	psrv := proto.NewGoPasteWebClient(webrpc.ProtoBuf, url)
	go waitloop(psrv)
}