use of pokeraidbot.domain.tracking.PokemonTrackingTarget in project pokeraidbot by magnusmickelsson.
the class UnTrackPokemonCommand method executeWithConfig.
@Override
protected void executeWithConfig(CommandEvent commandEvent, Config config) {
String args = commandEvent.getArgs();
final String userId = commandEvent.getAuthor().getId();
final User user = commandEvent.getAuthor();
if (args == null || args.length() < 1) {
trackingService.removeAllForUser(user);
commandEvent.reactSuccess();
} else {
Pokemon pokemon = pokemonRepository.search(args, user);
trackingService.removeForUser(new PokemonTrackingTarget(userId, pokemon), user);
commandEvent.reactSuccess();
}
removeOriginMessageIfConfigSaysSo(config, commandEvent);
}
Aggregations