aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-25 01:17:57 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-25 10:13:59 +0800
commit932c54f7a1b14949ac1d0f9a94c6d2a37b7a3a97 (patch)
tree3bbc907b5fa8b9a90ae98184a985896107250b53
parentDistinguish blah blah (diff)
downloadpowxy-932c54f7a1b14949ac1d0f9a94c6d2a37b7a3a97.tar.gz
powxy-932c54f7a1b14949ac1d0f9a94c6d2a37b7a3a97.tar.zst
powxy-932c54f7a1b14949ac1d0f9a94c6d2a37b7a3a97.zip
respect -irctls
-rw-r--r--irc.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/irc.go b/irc.go
index 06cb813..2577860 100644
--- a/irc.go
+++ b/irc.go
@@ -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
}