package com.mtz.qqbot.Tool;

import net.mamoe.mirai.event.events.GroupMessageEvent;

import java.util.List;
import java.util.Map;

public class invalidMember {
    public static void invalidCountList(Map<Long, Integer> groupMemberInvalidedCountList, GroupMessageEvent event) {
        if (groupMemberInvalidedCountList.get(event.getSender().getId()) == null) {
            groupMemberInvalidedCountList.put(event.getSender().getId(), 1);//初始化
        } else {
            int invalidCount = Integer.parseInt(String.valueOf(groupMemberInvalidedCountList.get(event.getSender().getId()))) + 1;
            groupMemberInvalidedCountList.put(event.getSender().getId(), invalidCount);
        }
    }

    public static void invalidMemberList(List<Long> groupInvalidMember, Map<Long, Integer> groupMemberInvalidedCountList, GroupMessageEvent event) {
        if (groupMemberInvalidedCountList.get(event.getSender().getId()).equals(5)) {
            groupInvalidMember.add(event.getSender().getId());
        }
    }
}
