some golint/vet and changed output format.
feedback in #exmormon said put url at end.
This commit is contained in:
+7
-5
@@ -11,8 +11,8 @@ import (
|
||||
irc "github.com/fluffle/goirc/client"
|
||||
)
|
||||
|
||||
var host *string = flag.String("host", "localhost:6668", "irc server hostname")
|
||||
var channel *string = flag.String("channel", "#exmormon", "irc channel")
|
||||
var host = flag.String("host", "localhost:6668", "irc server hostname")
|
||||
var channel = flag.String("channel", "#exmormon", "irc channel")
|
||||
|
||||
func main() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
@@ -21,17 +21,19 @@ func main() {
|
||||
|
||||
done := make(chan bool)
|
||||
|
||||
Register(*host, *channel, done)
|
||||
register(*host, *channel, done)
|
||||
<-done
|
||||
}
|
||||
|
||||
const name = "BYbot"
|
||||
|
||||
// BY is the Go embodiment of Brigham Young.
|
||||
type BY struct {
|
||||
quotes []string
|
||||
poke chan bool
|
||||
}
|
||||
|
||||
// Random returns a random BY quote. That asshat.
|
||||
func (by *BY) Random() string {
|
||||
if len(by.quotes) == 0 {
|
||||
return ""
|
||||
@@ -52,7 +54,7 @@ func (by *BY) spew(conn *irc.Conn, channel string) {
|
||||
}
|
||||
}
|
||||
|
||||
func Register(host, channel string, done chan<- bool) {
|
||||
func register(host, channel string, done chan<- bool) {
|
||||
var p *regexp.Regexp
|
||||
by := BY{
|
||||
quotes,
|
||||
@@ -95,7 +97,7 @@ func Register(host, channel string, done chan<- bool) {
|
||||
}
|
||||
}
|
||||
|
||||
var quotes []string = []string{
|
||||
var quotes = []string{
|
||||
"♬♬ God changed his mind about black people (black people!!) ♬♬",
|
||||
|
||||
"Wife! Bring me a wife!!",
|
||||
|
||||
Reference in New Issue
Block a user