diff --git a/config.go b/config.go index f9873766..32187d2b 100644 --- a/config.go +++ b/config.go @@ -13,6 +13,7 @@ type Config struct { Server string Port int Nick string + Password string Channel string } Mattermost struct { diff --git a/matterbridge.go b/matterbridge.go index 59165dfa..a07ab303 100644 --- a/matterbridge.go +++ b/matterbridge.go @@ -41,6 +41,9 @@ func (b *Bridge) createIRC(name string) *irc.Connection { i := irc.IRC(b.Config.IRC.Nick, b.Config.IRC.Nick) i.UseTLS = b.Config.IRC.UseTLS i.TLSConfig = &tls.Config{InsecureSkipVerify: b.Config.IRC.SkipTLSVerify} + if b.Config.IRC.Password != "" { + i.Password = b.Config.IRC.Password + } i.Connect(b.Config.IRC.Server + ":" + strconv.Itoa(b.Config.IRC.Port)) time.Sleep(time.Second) log.Println("Joining", b.Config.IRC.Channel, "as", b.Config.IRC.Nick)