1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-08 04:55:55 +08:00

Merge pull request #718 from sam01101/dev

Fixes #717
This commit is contained in:
Mrs4s 2021-03-14 21:06:32 +08:00 committed by GitHub
commit 3200ac2b5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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