Skip to content

Commit

Permalink
imp: 私聊找不到人不进入风控提示
Browse files Browse the repository at this point in the history
  • Loading branch information
fy0 committed Oct 10, 2023
1 parent 35b478f commit cba8900
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coolq/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ func (bot *CQBot) SendPrivateMessage(target int64, groupID int64, m *message.Sen
switch {
case groupID != 0 && bot.Client.FindGroup(groupID) == nil:
log.Errorf("错误: 找不到群(%v)", groupID)
return 0 // 防止触发风控临时措施
case groupID != 0 && !bot.Client.FindGroup(groupID).AdministratorOrOwner():
log.Errorf("错误: 机器人在群(%v) 为非管理员或群主, 无法主动发起临时会话", groupID)
case groupID != 0 && bot.Client.FindGroup(groupID).FindMember(target) == nil:
Expand Down Expand Up @@ -403,6 +404,7 @@ func (bot *CQBot) SendPrivateMessage(target int64, groupID int64, m *message.Sen
nickname = summaryInfo.Nickname
}
log.Errorf("错误: 请先添加 %v(%v) 为好友", nickname, target)
return 0 // 防止触发风控临时措施
}
return id
}
Expand Down

0 comments on commit cba8900

Please sign in to comment.