This commit is contained in:
Jonas Rabenstein 2025-01-25 00:23:42 +01:00
commit 2cd84df2ba
5 changed files with 36 additions and 36 deletions

15
bot.go
View file

@ -1,15 +1,14 @@
package main
import (
"log"
"fmt"
"net"
"time"
"bufio"
"strings"
"database/sql"
configo "github.com/distributedio/configo"
"flag"
"fmt"
_ "github.com/mattn/go-sqlite3"
"net"
"strings"
"time"
)
func sendmsg(conn net.Conn, channel string, msg string) {
@ -18,7 +17,7 @@ func sendmsg(conn net.Conn, channel string, msg string) {
conn.Write([]byte(mesg))
}
func scanline_privmsg (msg string, irc *irc_msg) {
func scanline_privmsg(msg string, irc *irc_msg) {
LOG_ERR.Printf(msg)
msg = msg[1:]
@ -30,7 +29,7 @@ func scanline_privmsg (msg string, irc *irc_msg) {
(*irc).channel, (*irc).msg = t[0], t[1]
t = strings.Split((*irc).msg, "\r\n")
(*irc).msg = strings.TrimSpace(t[0])
if ! strings.HasPrefix((*irc).channel, "#") {
if !strings.HasPrefix((*irc).channel, "#") {
(*irc).channel = (*irc).author
}
(*irc).retmsg = ""