Limit the number of group members for kick/create/invite

This commit is contained in:
skiffer-git
2022-09-09 15:52:47 +08:00
parent 5b399d0d06
commit 98d7c7bb86
6 changed files with 27 additions and 16 deletions
+12
View File
@@ -107,3 +107,15 @@ func int64ToString(i int64) string {
func Int64ToString(i int64) string {
return strconv.FormatInt(i, 10)
}
func RemoveDuplicateElement(idList []string) []string {
result := make([]string, 0, len(idList))
temp := map[string]struct{}{}
for _, item := range idList {
if _, ok := temp[item]; !ok {
temp[item] = struct{}{}
result = append(result, item)
}
}
return result
}