Skip to content

Commit

Permalink
BUG修复
Browse files Browse the repository at this point in the history
修复收到异常消息可能导致的错误
  • Loading branch information
cnxysoft committed Jul 11, 2024
1 parent 1419635 commit 6ac09b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- 修改事件处理方式,降低上游负载
- 修复用户白名单(Debug)失效的问题
- 修复退群事件找不到群员0的问题
- 修复收到异常消息可能导致的错误
- 新增两个模板:群名片变更、群权限变更
- 名称:trigger.group.card_updated.tmpl
- 模板变量:group_code、member_code、old_member_name、member_name
Expand Down
15 changes: 9 additions & 6 deletions lsp/parser/parser.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package parser

import (
"strings"
"sync"

"github.com/Mrs4s/MiraiGo/message"
"github.com/Sora233/DDBOT/lsp/cfg"
"github.com/Sora233/DDBOT/utils"
"strings"
"sync"
)

type Parser struct {
Expand All @@ -25,10 +26,12 @@ func (p *Parser) Parse(elems []message.IMessageElement) {
if len(elems) > 0 {
var search []message.IMessageElement
if elems[0].Type() == message.Reply {
if elems[1].Type() == message.At {
search = elems[2:]
} else {
search = elems[1:]
if len(elems) > 1 {
if elems[1].Type() == message.At {
search = elems[2:]
} else {
search = elems[1:]
}
}
} else {
search = elems[:]
Expand Down
2 changes: 1 addition & 1 deletion lsp/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

var (
CommitId = "UNKNOWN"
BuildTime = "2024-07-11 03:23:00"
BuildTime = "2024-07-11 21:52:00"
Tags = "fix_A027"
)

Expand Down

0 comments on commit 6ac09b6

Please sign in to comment.