Compare commits
No commits in common. "4c08c5caeb409b9f76692644ea335b7016810d52" and "4fcf1779de993a279292fec88f19c38ececc6af9" have entirely different histories.
4c08c5caeb
...
4fcf1779de
@ -38,7 +38,7 @@ func ClearGroupUser() {
|
||||
memberMap[member.Nickname] = member.LastActive.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
// 调用接口
|
||||
utils.DeleteGroupMember(group.Wxid, strings.Join(deleteIds, ","), 0, false)
|
||||
utils.DeleteGroupMember(group.Wxid, strings.Join(deleteIds, ","), 0)
|
||||
// 发送通知到群里
|
||||
ms := make([]string, 0)
|
||||
for k, v := range memberMap {
|
||||
|
@ -126,9 +126,7 @@ func SendEmotion(toId, emotionHash string, retryCount int) {
|
||||
// @description: 删除群成员
|
||||
// @param chatRoomId 群Id
|
||||
// @param memberIds 成员id,用','分隔
|
||||
// @param retryCount 重试次数
|
||||
// @param isSure 是否确认删除
|
||||
func DeleteGroupMember(chatRoomId, memberIds string, retryCount int, isSure bool) {
|
||||
func DeleteGroupMember(chatRoomId, memberIds string, retryCount int) {
|
||||
if retryCount > 5 {
|
||||
log.Printf("重试五次失败,停止发送")
|
||||
return
|
||||
@ -150,11 +148,9 @@ func DeleteGroupMember(chatRoomId, memberIds string, retryCount int, isSure bool
|
||||
log.Printf("删除群成员失败: %s", err.Error())
|
||||
// 休眠五秒后重新发送
|
||||
time.Sleep(5 * time.Second)
|
||||
DeleteGroupMember(chatRoomId, memberIds, retryCount+1, isSure)
|
||||
DeleteGroupMember(chatRoomId, memberIds, retryCount+1)
|
||||
}
|
||||
log.Printf("[%s]删除群成员结果: %s", chatRoomId, resp.String())
|
||||
log.Printf("删除群成员结果: %s", resp.String())
|
||||
// 这个逼接口要调用两次,第一次调用成功,第二次调用才会真正删除
|
||||
if !isSure {
|
||||
DeleteGroupMember(chatRoomId, memberIds, 5, true)
|
||||
}
|
||||
DeleteGroupMember(chatRoomId, memberIds, 5)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user