1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00
This commit is contained in:
Sam 2021-03-13 13:24:21 +08:00
parent ee91df70b2
commit 2febee01d9
No known key found for this signature in database
GPG Key ID: 2057906F881702DD

View File

@ -295,7 +295,10 @@ func (bot *CQBot) SendPrivateMessage(target int64, groupId int64, m *message.Sen
id = bot.InsertPrivateMessage(msg)
}
} else if code, ok := bot.tempMsgCache.Load(target); ok || groupId != 0 { // 临时会话
if groupId != 0 && !bot.Client.FindGroup(groupId).AdministratorOrOwner() {
if bot.Client.FindGroup(groupId) == nil {
log.Errorf("错误: 找不到群(%v)", groupId)
id = -1
} else if groupId != 0 && !bot.Client.FindGroup(groupId).AdministratorOrOwner() {
log.Errorf("错误: 机器人在群(%v) 为非管理员或群主, 无法主动发起临时会话", groupId)
id = -1
} else if groupId != 0 && bot.Client.FindGroup(groupId).FindMember(target) == nil {