diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-25 01:17:57 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-25 10:13:59 +0800 |
commit | 932c54f7a1b14949ac1d0f9a94c6d2a37b7a3a97 (patch) | |
tree | 3bbc907b5fa8b9a90ae98184a985896107250b53 | |
parent | Distinguish blah blah (diff) | |
download | powxy-932c54f7a1b14949ac1d0f9a94c6d2a37b7a3a97.tar.gz powxy-932c54f7a1b14949ac1d0f9a94c6d2a37b7a3a97.tar.zst powxy-932c54f7a1b14949ac1d0f9a94c6d2a37b7a3a97.zip |
respect -irctls
-rw-r--r-- | irc.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -3,6 +3,7 @@ package main import ( "crypto/tls" "fmt" + "net" irc "go.lindenii.runxiyu.org/lindenii-irc" ) @@ -18,7 +19,13 @@ type errorBack[T any] struct { } func ircBotSession() error { - underlyingConn, err := tls.Dial(ircNet, ircAddr, nil) + var err error + var underlyingConn net.Conn + if ircTLS { + underlyingConn, err = tls.Dial(ircNet, ircAddr, nil) + } else { + underlyingConn, err = net.Dial(ircNet, ircAddr) + } if err != nil { return err } |