🐛 修复系统消息类型的Content为空的bug

This commit is contained in:
eatmoreapple 2021-12-17 11:06:49 +08:00
parent 26473a5320
commit 2db696d642

View File

@ -388,6 +388,7 @@ func (m *Message) init(bot *Bot) {
m.Raw = raw
// 如果是群消息
if m.IsSendByGroup() {
if m.MsgType == MsgTypeText {
// 将Username和正文分开
data := strings.Split(m.Content, ":<br/>")
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)
// 处理html转义字符