Search in sources :

Example 1 with PokemonTrackingTarget

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);
}
Also used : User(net.dv8tion.jda.core.entities.User) PokemonTrackingTarget(pokeraidbot.domain.tracking.PokemonTrackingTarget) Pokemon(pokeraidbot.domain.pokemon.Pokemon)

Aggregations

User (net.dv8tion.jda.core.entities.User)1 Pokemon (pokeraidbot.domain.pokemon.Pokemon)1 PokemonTrackingTarget (pokeraidbot.domain.tracking.PokemonTrackingTarget)1