Compare commits

..

No commits in common. "4c08c5caeb409b9f76692644ea335b7016810d52" and "4fcf1779de993a279292fec88f19c38ececc6af9" have entirely different histories.

2 changed files with 5 additions and 9 deletions

View File

@ -38,7 +38,7 @@ func ClearGroupUser() {
memberMap[member.Nickname] = member.LastActive.Format("2006-01-02 15:04:05") 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) ms := make([]string, 0)
for k, v := range memberMap { for k, v := range memberMap {

View File

@ -126,9 +126,7 @@ func SendEmotion(toId, emotionHash string, retryCount int) {
// @description: 删除群成员 // @description: 删除群成员
// @param chatRoomId 群Id // @param chatRoomId 群Id
// @param memberIds 成员id,用','分隔 // @param memberIds 成员id,用','分隔
// @param retryCount 重试次数 func DeleteGroupMember(chatRoomId, memberIds string, retryCount int) {
// @param isSure 是否确认删除
func DeleteGroupMember(chatRoomId, memberIds string, retryCount int, isSure bool) {
if retryCount > 5 { if retryCount > 5 {
log.Printf("重试五次失败,停止发送") log.Printf("重试五次失败,停止发送")
return return
@ -150,11 +148,9 @@ func DeleteGroupMember(chatRoomId, memberIds string, retryCount int, isSure bool
log.Printf("删除群成员失败: %s", err.Error()) log.Printf("删除群成员失败: %s", err.Error())
// 休眠五秒后重新发送 // 休眠五秒后重新发送
time.Sleep(5 * time.Second) 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)
DeleteGroupMember(chatRoomId, memberIds, 5, true)
}
} }