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 toggleCommandChannelDisabledness(MyCommand<?> myCommand, long guildId, long channelId, boolean expectedResult, ChuuService service) {
        Pair<Long, Long> channel = Pair.of(guildId, channelId);
        boolean serverSet = disabledServersMap.containsMapping(guildId, myCommand);
        if (expectedResult) {
            disabledServersMap.removeMapping(channel, myCommand);
            service.deleteChannelCommandStatus(guildId, channelId, myCommand.getName());
            if (serverSet) {
                enabledChannelsMap.put(channel, myCommand);
                service.insertChannelCommandStatus(guildId, channelId, myCommand.getName(), true);
            }  
        } else {
            enabledChannelsMap.removeMapping(channel, myCommand);
            service.deleteChannelCommandStatus(guildId, channelId, myCommand.getName());
            if (!serverSet) {
                disabledChannelsMap.put(channel, myCommand);
                service.insertChannelCommandStatus(guildId, channelId, myCommand.getName(), false);
            }
        }
    }
public static void toggleCommandChannelDisabledness ( MyCommand < ? > myCommand , long guildId , long channelId , boolean expectedResult , ChuuService service ) { Pair < Long , Long > channel = Pair . of ( guildId , channelId ) ; boolean serverSet = disabledServersMap . containsMapping ( guildId , myCommand ) ; if ( expectedResult ) { disabledServersMap . removeMapping ( channel , myCommand ) ; service . deleteChannelCommandStatus ( guildId , channelId , myCommand . getName ( ) ) ; if ( serverSet ) { enabledChannelsMap . put ( channel , myCommand ) ; service . insertChannelCommandStatus ( guildId , channelId , myCommand . getName ( ) , true ) ; } } else { enabledChannelsMap . removeMapping ( channel , myCommand ) ; service . deleteChannelCommandStatus ( guildId , channelId , myCommand . getName ( ) ) ; if ( ! serverSet ) { disabledChannelsMap . put ( channel , myCommand ) ; service . insertChannelCommandStatus ( guildId , channelId , myCommand . getName ( ) , false ) ; } } }
Returns if its disabled or enabled now
Returns if its disabled or enabled now
//Do Nothing // If this command was disabled server wide