🐛 修复系统消息类型的Content为空的bug
This commit is contained in:
parent
26473a5320
commit
2db696d642
@ -388,6 +388,7 @@ func (m *Message) init(bot *Bot) {
|
|||||||
m.Raw = raw
|
m.Raw = raw
|
||||||
// 如果是群消息
|
// 如果是群消息
|
||||||
if m.IsSendByGroup() {
|
if m.IsSendByGroup() {
|
||||||
|
if m.MsgType == MsgTypeText {
|
||||||
// 将Username和正文分开
|
// 将Username和正文分开
|
||||||
data := strings.Split(m.Content, ":<br/>")
|
data := strings.Split(m.Content, ":<br/>")
|
||||||
m.Content = strings.Join(data[1:], "")
|
m.Content = strings.Join(data[1:], "")
|
||||||
@ -406,6 +407,7 @@ func (m *Message) init(bot *Bot) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 处理消息中的换行
|
// 处理消息中的换行
|
||||||
m.Content = strings.Replace(m.Content, `<br/>`, "\n", -1)
|
m.Content = strings.Replace(m.Content, `<br/>`, "\n", -1)
|
||||||
// 处理html转义字符
|
// 处理html转义字符
|
||||||
|
Loading…
x
Reference in New Issue
Block a user