irc-webhooks/src/main.go

29 lines
604 B
Go
Raw Permalink Normal View History

2018-11-16 16:43:18 +00:00
package main
2018-11-16 20:34:38 +00:00
import "fmt"
2018-11-17 18:39:54 +00:00
2018-11-16 20:34:38 +00:00
const configPrint = `
CONFIG:
Secret: %q
BindHost: %q
BindPort: %q
`
2018-11-17 18:39:54 +00:00
func main() {
2018-11-16 19:31:45 +00:00
config := getConfig()
2018-11-16 20:34:38 +00:00
fmt.Printf(configPrint, config.Secret, config.BindHost, config.BindPort)
2018-11-17 19:03:51 +00:00
msgChan := make(chan string)
2018-11-17 18:39:54 +00:00
bc := BotConfig{
Nick: config.Nick,
Ident: config.Ident,
Realname: config.Realname,
ChansToJoin: config.ChansToJoin,
2018-11-17 19:03:51 +00:00
MsgChan: msgChan,
2018-11-17 18:39:54 +00:00
}
2018-11-18 15:35:11 +00:00
bot := newBot(bc, config.ServerHost, config.ServerPort, config.ServerName, config.ServerSSL)
2018-11-16 20:34:38 +00:00
2018-11-17 18:39:54 +00:00
go bot.run()
2018-11-17 19:03:51 +00:00
ListenForWebHook(config, msgChan)
2018-11-16 16:43:18 +00:00
}