src/main/java/core/Chuu.java
//Returns if its disabled or enabled now
Returns if its disabled or enabled now
Returns if its disabled or enabled now
public static void toggleCommandDisabledness(MyCommand<?> myCommand, long guildId, boolean expectedResult, ChuuService service) {
        if (expectedResult) {
            disabledServersMap.removeMapping(guildId, myCommand);
            service.deleteServerCommandStatus(guildId, myCommand.getName());
            Set<Long> collect = disabledChannelsMap.entries().stream().filter(x -> x.getKey().getLeft().equals(guildId)).map(x -> x.getKey().getRight()).collect(Collectors.toSet());
            disabledChannelsMap.entries().removeIf(x -> x.getKey().getLeft().equals(guildId));
            collect.forEach(y -> service.deleteChannelCommandStatus(guildId, y, myCommand.getName()));
            service.deleteServerCommandStatus(guildId, myCommand.getName());
        } else {
            disabledServersMap.put(guildId, myCommand);
            service.insertServerDisabled(guildId, myCommand.getName());
        }
    }
public static void toggleCommandDisabledness ( MyCommand < ? > myCommand , long guildId , boolean expectedResult , ChuuService service ) { if ( expectedResult ) { disabledServersMap . removeMapping ( guildId , myCommand ) ; service . deleteServerCommandStatus ( guildId , myCommand . getName ( ) ) ; Set < Long > collect = disabledChannelsMap . entries ( ) . stream ( ) . filter ( x -> x . getKey ( ) . getLeft ( ) . equals ( guildId ) ) . map ( x -> x . getKey ( ) . getRight ( ) ) . collect ( Collectors . toSet ( ) ) ; disabledChannelsMap . entries ( ) . removeIf ( x -> x . getKey ( ) . getLeft ( ) . equals ( guildId ) ) ; collect . forEach ( y -> service . deleteChannelCommandStatus ( guildId , y , myCommand . getName ( ) ) ) ; service . deleteServerCommandStatus ( guildId , myCommand . getName ( ) ) ; } else { disabledServersMap . put ( guildId , myCommand ) ; service . insertServerDisabled ( guildId , myCommand . getName ( ) ) ; } }
Returns if its disabled or enabled now
Returns if its disabled or enabled now