Skip to content

Commit

Permalink
遗憾宣布gtihub.com停运(笑
Browse files Browse the repository at this point in the history
  • Loading branch information
kyokukong committed Sep 19, 2024
1 parent a166e5b commit 0445eca
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 57 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

![Go Badge](https://img.shields.io/badge/Go-1.22%2B-cyan?logo=go)
![workflow](https://github.com/Iceinu-Project/iceinu/actions/workflows/go.yml/badge.svg)
![QQGroup Badge](https://img.shields.io/badge/QQ群-970801565-blue?)

氷犬Iceinu 是一个多用途的Go语言聊天机器人框架(主要为NTQQ设计),可以将其作为开发套件来进行二次开发,亦或者作为库按需引入来快速编写自己的聊天机器人(暂时没有实现)。

Expand Down
20 changes: 18 additions & 2 deletions adapter/lagrange/element_converter.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package lagrange

import (
"github.com/Iceinu-Project/iceinu/elements"
"github.com/LagrangeDev/LagrangeGo/message"
"gtihub.com/Iceinu-Project/iceinu/elements"
"strconv"
"strings"
"time"
)

Expand All @@ -17,7 +18,22 @@ func ConvertIceElement(e []message.IMessageElement) *[]elements.IceinuMessageEle
// 将元素依次对应转换并传入
case message.Text:
ele := ele.(*message.TextElement)
IceinuElements = append(IceinuElements, &elements.TextElement{Text: ele.Content})
// 检测文本中是否包含换行符
if strings.Contains(ele.Content, "\n") {
// 如果包含换行符,进行拆分和处理
textParts := strings.Split(ele.Content, "\n")
for i, part := range textParts {
// 将每段文本添加到 IceinuElements
IceinuElements = append(IceinuElements, &elements.TextElement{Text: part})
// 如果不是最后一段文本,则插入 BrElement
if i < len(textParts)-1 {
IceinuElements = append(IceinuElements, &elements.BrElement{})
}
}
} else {
// 如果不包含换行符,直接添加文本元素
IceinuElements = append(IceinuElements, &elements.TextElement{Text: ele.Content})
}
case message.At:
ele := ele.(*message.AtElement)
IceinuElements = append(IceinuElements, &elements.AtElement{
Expand Down
8 changes: 4 additions & 4 deletions adapter/lagrange/lagrange_adapter.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package lagrange

import (
"github.com/Iceinu-Project/iceinu/adapter"
"github.com/Iceinu-Project/iceinu/config"
"github.com/Iceinu-Project/iceinu/ice"
"github.com/Iceinu-Project/iceinu/logger"
"github.com/LagrangeDev/LagrangeGo/client"
"github.com/LagrangeDev/LagrangeGo/client/auth"
"github.com/sirupsen/logrus"
"gtihub.com/Iceinu-Project/iceinu/adapter"
"gtihub.com/Iceinu-Project/iceinu/config"
"gtihub.com/Iceinu-Project/iceinu/ice"
"gtihub.com/Iceinu-Project/iceinu/logger"
"os"
"os/signal"
"syscall"
Expand Down
2 changes: 1 addition & 1 deletion adapter/lagrange/lagrange_config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package lagrange

import "gtihub.com/Iceinu-Project/iceinu/config"
import "github.com/Iceinu-Project/iceinu/config"

type AdapterLagrangeConfig struct {
Account int `toml:"account"`
Expand Down
8 changes: 4 additions & 4 deletions adapter/lagrange/lagrange_handler.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package lagrange

import (
"github.com/Iceinu-Project/iceinu/logger"
"github.com/Iceinu-Project/iceinu/resource"
"github.com/Iceinu-Project/iceinu/utils"
"github.com/LagrangeDev/LagrangeGo/client"
"github.com/LagrangeDev/LagrangeGo/message"
"gtihub.com/Iceinu-Project/iceinu/logger"
"gtihub.com/Iceinu-Project/iceinu/resource"
"gtihub.com/Iceinu-Project/iceinu/utils"
"strconv"
"time"

"gtihub.com/Iceinu-Project/iceinu/ice"
"github.com/Iceinu-Project/iceinu/ice"
)

func SetAllHandler() {
Expand Down
2 changes: 1 addition & 1 deletion config/config_manager.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package config

import (
"github.com/Iceinu-Project/iceinu/logger"
"github.com/pelletier/go-toml"
"gtihub.com/Iceinu-Project/iceinu/logger"
"os"
"path/filepath"
"reflect"
Expand Down
15 changes: 0 additions & 15 deletions doc/draft/事件总线.md

This file was deleted.

2 changes: 0 additions & 2 deletions doc/draft/关于草稿.md

This file was deleted.

12 changes: 0 additions & 12 deletions doc/draft/适配器.md

This file was deleted.

14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module gtihub.com/Iceinu-Project/iceinu
module github.com/Iceinu-Project/iceinu

go 1.22

require (
github.com/KyokuKong/gradients v0.0.0-20240910005044-45c73fcaed90
github.com/LagrangeDev/LagrangeGo v0.0.0-20240914013831-60efc5a57666
github.com/LagrangeDev/LagrangeGo v0.0.0-20240916064511-7e6af3753ba4
github.com/pelletier/go-toml v1.9.5
github.com/sirupsen/logrus v1.9.3
)
Expand All @@ -15,11 +15,11 @@ require (
github.com/fumiama/gofastTEA v0.0.10 // indirect
github.com/fumiama/imgsz v0.0.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/tidwall/gjson v1.17.1 // indirect
github.com/tidwall/gjson v1.17.3 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
golang.org/x/image v0.18.0 // indirect
golang.org/x/net v0.25.0 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
golang.org/x/image v0.20.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/sys v0.25.0 // indirect
)
2 changes: 1 addition & 1 deletion ice/adapter_events.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ice

import (
"gtihub.com/Iceinu-Project/iceinu/adapter"
"github.com/Iceinu-Project/iceinu/adapter"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion ice/uni_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ice
import (
"time"

"gtihub.com/Iceinu-Project/iceinu/resource"
"github.com/Iceinu-Project/iceinu/resource"
)

// PlatformEvent Iceinu的基础平台事件结构体,基本参考了Satori的设计,用于实现跨平台的统一事件格式
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package main

import (
"flag"
"gtihub.com/Iceinu-Project/iceinu/adapter"
"gtihub.com/Iceinu-Project/iceinu/adapter/lagrange"
"gtihub.com/Iceinu-Project/iceinu/config"
"gtihub.com/Iceinu-Project/iceinu/ice"
"gtihub.com/Iceinu-Project/iceinu/logger"
"github.com/Iceinu-Project/iceinu/adapter"
"github.com/Iceinu-Project/iceinu/adapter/lagrange"
"github.com/Iceinu-Project/iceinu/config"
"github.com/Iceinu-Project/iceinu/ice"
"github.com/Iceinu-Project/iceinu/logger"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion resource/message.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package resource

import (
"gtihub.com/Iceinu-Project/iceinu/elements"
"github.com/Iceinu-Project/iceinu/elements"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion utils/satorize.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package utils

import (
"gtihub.com/Iceinu-Project/iceinu/elements"
"github.com/Iceinu-Project/iceinu/elements"
"strings"
)

Expand Down

0 comments on commit 0445eca

Please sign in to comment.