Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta488 #493

Merged
merged 44 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a6ebe57
beta447
Hoshinonyaruko Jun 29, 2024
1d63fae
beta448
Hoshinonyaruko Jul 1, 2024
cd34627
beta449
Hoshinonyaruko Jul 4, 2024
b790b29
beta450
Hoshinonyaruko Jul 4, 2024
7a9b56a
beta451
Hoshinonyaruko Jul 4, 2024
e17d0d4
beta452
Hoshinonyaruko Jul 4, 2024
1318175
beta453
Hoshinonyaruko Jul 4, 2024
b7f291c
beta454
Hoshinonyaruko Jul 4, 2024
f921895
beta455
Hoshinonyaruko Jul 9, 2024
24108c6
btea455
Hoshinonyaruko Jul 9, 2024
7cdc968
beta456
Hoshinonyaruko Jul 9, 2024
b5d784e
beta457
Hoshinonyaruko Jul 9, 2024
61e4001
beta458
Hoshinonyaruko Jul 9, 2024
6d4116a
beta460
Hoshinonyaruko Jul 9, 2024
2c1f1b7
beta460
Hoshinonyaruko Jul 11, 2024
5c312cd
beta461
Hoshinonyaruko Jul 12, 2024
58304eb
beta462
Hoshinonyaruko Jul 13, 2024
7e7c9f3
beta463
Hoshinonyaruko Jul 15, 2024
188f250
beta464
Hoshinonyaruko Jul 15, 2024
af0296d
beta465
Hoshinonyaruko Jul 18, 2024
500135c
beta467
Hoshinonyaruko Jul 21, 2024
c1a588c
beta468
Hoshinonyaruko Jul 21, 2024
1df8e15
beta469
Hoshinonyaruko Jul 21, 2024
f57ab7b
beta470
Hoshinonyaruko Jul 26, 2024
cd21ad9
beta471
Hoshinonyaruko Aug 1, 2024
6039272
beta472
Hoshinonyaruko Aug 1, 2024
c45b450
beta473
Hoshinonyaruko Aug 1, 2024
f89d6c5
beta473
Hoshinonyaruko Aug 3, 2024
b54fdee
beta475
Hoshinonyaruko Aug 5, 2024
a30a697
beta476
Hoshinonyaruko Aug 8, 2024
ab805cc
beta478
Hoshinonyaruko Aug 8, 2024
6debefd
beta479
Hoshinonyaruko Aug 17, 2024
9cc7e5d
beta479
Hoshinonyaruko Aug 17, 2024
c0fe93c
beta480
Hoshinonyaruko Aug 18, 2024
91cf223
beta481
Hoshinonyaruko Aug 18, 2024
a3aa6c1
beta482
Hoshinonyaruko Aug 18, 2024
0917e56
beta483
Hoshinonyaruko Aug 19, 2024
dd1f774
beta484
Hoshinonyaruko Aug 19, 2024
1c87d61
beta485
Hoshinonyaruko Aug 20, 2024
aac474a
beta486
Hoshinonyaruko Aug 20, 2024
2604eb7
beta486
Hoshinonyaruko Aug 20, 2024
76377be
beta487
Hoshinonyaruko Aug 20, 2024
cb095ec
beta487
Hoshinonyaruko Aug 20, 2024
9d696e7
Merge branch 'main' into beta488
Hoshinonyaruko Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions Processor/ProcessC2CMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"log"
"strconv"
"strings"
"time"

"github.com/hoshinonyaruko/gensokyo/config"
Expand Down Expand Up @@ -349,11 +350,32 @@ func (p *Processors) ProcessC2CMessage(data *dto.WSC2CMessageData) error {
selfid64 = int64(p.Settings.AppID)
}

//转换at
messageText := handlers.RevertTransformedText(data, "group_private", p.Api, p.Apiv2, 0, 0, config.GetWhiteEnable(5))
if messageText == "" {
mylog.Printf("信息被自定义黑白名单拦截")
return nil
var messageText string
//当屏蔽错误通道时候=性能模式 不解析at 不解析图片
if !config.GetDisableErrorChan() {
//转换at
messageText = handlers.RevertTransformedText(data, "group_private", p.Api, p.Apiv2, 0, 0, config.GetWhiteEnable(5))
if messageText == "" {
mylog.Printf("信息被自定义黑白名单拦截")
return nil
}
} else {
messageText = data.Content
if messageText == "/ " {
messageText = " "
}
if messageText == " / " {
messageText = " "
}
messageText = strings.TrimSpace(messageText)

// 检查是否需要移除前缀
if config.GetRemovePrefixValue() {
// 移除消息内容中第一次出现的 "/"
if idx := strings.Index(messageText, "/"); idx != -1 {
messageText = messageText[:idx] + messageText[idx+1:]
}
}
}

groupMsg := OnebotGroupMessageS{
Expand Down
42 changes: 35 additions & 7 deletions Processor/ProcessGroupMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"log"
"strconv"
"strings"
"time"

"github.com/hoshinonyaruko/gensokyo/config"
Expand Down Expand Up @@ -75,18 +76,45 @@ func (p *Processors) ProcessGroupMessage(data *dto.WSGroupATMessageData) error {
}
}

// 转换at
messageText := handlers.RevertTransformedText(data, "group", p.Api, p.Apiv2, GroupID64, userid64, config.GetWhiteEnable(4))
if messageText == "" {
mylog.Printf("信息被自定义黑白名单拦截")
return nil
var messageText string
//当屏蔽错误通道时候=性能模式 不解析at 不解析图片
if !config.GetDisableErrorChan() {
// 转换at
messageText = handlers.RevertTransformedText(data, "group", p.Api, p.Apiv2, GroupID64, userid64, config.GetWhiteEnable(4))
if messageText == "" {
mylog.Printf("信息被自定义黑白名单拦截")
return nil
}

//框架内指令
p.HandleFrameworkCommand(messageText, data, "group")
} else {
// 减少无用的性能开支
messageText = data.Content

if messageText == "/ " {
messageText = " "
}

if messageText == " / " {
messageText = " "
}
messageText = strings.TrimSpace(messageText)

// 检查是否需要移除前缀
if config.GetRemovePrefixValue() {
// 移除消息内容中第一次出现的 "/"
if idx := strings.Index(messageText, "/"); idx != -1 {
messageText = messageText[:idx] + messageText[idx+1:]
}
}

}

//群没有at,但用户可以选择加一个
if config.GetAddAtGroup() {
messageText = "[CQ:at,qq=" + config.GetAppIDStr() + "] " + messageText
}
//框架内指令
p.HandleFrameworkCommand(messageText, data, "group")

var messageID int
//映射str的messageID到int
Expand Down
Loading