aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-05-13 16:30:11 +0000
committerterminaldweller <devi@terminaldweller.com>2024-05-13 16:30:11 +0000
commit7b6605142343a622a982ca36da5ee6fbd1cd9a19 (patch)
tree5cbb6026f9e4d87f4fbac5f7db7da14ffb575a52 /main.go
parentadded a config file for golangci-lint (diff)
downloadmilla-7b6605142343a622a982ca36da5ee6fbd1cd9a19.tar.gz
milla-7b6605142343a622a982ca36da5ee6fbd1cd9a19.zip
updated the readme, added example config file
Diffstat (limited to 'main.go')
-rw-r--r--main.go39
1 files changed, 19 insertions, 20 deletions
diff --git a/main.go b/main.go
index 7555e00..b470738 100644
--- a/main.go
+++ b/main.go
@@ -13,7 +13,6 @@ import (
"net/url"
"os"
"reflect"
- "regexp"
"strconv"
"strings"
"time"
@@ -138,26 +137,26 @@ func returnGeminiResponse(resp *genai.GenerateContentResponse) string {
return result
}
-func extractLast256ColorEscapeCode(str string) (string, error) {
- pattern256F := `\033\[38;5;(\d+)m`
- // pattern256B := `\033\[48;5;(\d+)m`
- // pattern16mF := `\033\[38;2;(\d+);(\d+);(\d+)m`
- // pattern16mB := `\033\[48;2;(\d+);(\d+);(\d+)m`
+// func extractLast256ColorEscapeCode(str string) (string, error) {
+// pattern256F := `\033\[38;5;(\d+)m`
+// // pattern256B := `\033\[48;5;(\d+)m`
+// // pattern16mF := `\033\[38;2;(\d+);(\d+);(\d+)m`
+// // pattern16mB := `\033\[48;2;(\d+);(\d+);(\d+)m`
- r, err := regexp.Compile(pattern256F)
- if err != nil {
- return "", fmt.Errorf("failed to compile regular expression: %w", err)
- }
+// r, err := regexp.Compile(pattern256F)
+// if err != nil {
+// return "", fmt.Errorf("failed to compile regular expression: %w", err)
+// }
- matches := r.FindAllStringSubmatch(str, -1)
- if len(matches) == 0 {
- return "", nil
- }
+// matches := r.FindAllStringSubmatch(str, -1)
+// if len(matches) == 0 {
+// return "", nil
+// }
- lastMatch := matches[len(matches)-1]
+// lastMatch := matches[len(matches)-1]
- return lastMatch[1], nil
-}
+// return lastMatch[1], nil
+// }
func chunker(inputString string, chromaFormatter string) []string {
chunks := strings.Split(inputString, "\n")
@@ -677,9 +676,9 @@ func runIRC(appConfig TomlConfig, ircChan chan *girc.Client) {
}
}
- if appConfig.EnableSasl && appConfig.ClientCertPath != "" {
- // TODO - add client cert support
- }
+ // if appConfig.EnableSasl && appConfig.ClientCertPath != "" {
+ // // TODO - add client cert support
+ // }
irc.Handlers.AddBg(girc.CONNECTED, func(c *girc.Client, e girc.Event) {
for _, channel := range appConfig.IrcChannels {