Search in sources :

Example 1 with QueryBuilderFactory

use of net.robinfriedli.aiode.persist.qb.QueryBuilderFactory in project aiode by robinfriedli.

the class DeleteGrantedRolesForDeletedRolesTask method run.

@Override
protected void run(JobExecutionContext jobExecutionContext) {
    Aiode aiode = Aiode.get();
    ShardManager shardManager = aiode.getShardManager();
    QueryBuilderFactory queryBuilderFactory = aiode.getQueryBuilderFactory();
    StaticSessionProvider.consumeSession(session -> {
        List<GuildSpecification> guildSpecifications = queryBuilderFactory.find(GuildSpecification.class).build(session).getResultList();
        int deletionCounter = 0;
        for (GuildSpecification guildSpecification : guildSpecifications) {
            Guild guild = guildSpecification.getGuild(shardManager);
            if (guild == null) {
                continue;
            }
            for (AccessConfiguration accessConfiguration : guildSpecification.getAccessConfigurations()) {
                Set<GrantedRole> grantedRoles = accessConfiguration.getRoles();
                for (GrantedRole grantedRole : grantedRoles) {
                    Role guildRole = grantedRole.getRole(guild);
                    if (guildRole == null) {
                        // role has been deleted
                        accessConfiguration.removeRole(grantedRole);
                        session.delete(grantedRole);
                        ++deletionCounter;
                    }
                }
            }
        }
        if (deletionCounter > 0) {
            logger.info("Deleted " + deletionCounter + " GrantedRole entities for roles that no longer exist");
        }
    });
}
Also used : Role(net.dv8tion.jda.api.entities.Role) GrantedRole(net.robinfriedli.aiode.entities.GrantedRole) QueryBuilderFactory(net.robinfriedli.aiode.persist.qb.QueryBuilderFactory) GrantedRole(net.robinfriedli.aiode.entities.GrantedRole) GuildSpecification(net.robinfriedli.aiode.entities.GuildSpecification) ShardManager(net.dv8tion.jda.api.sharding.ShardManager) Guild(net.dv8tion.jda.api.entities.Guild) Aiode(net.robinfriedli.aiode.Aiode) AccessConfiguration(net.robinfriedli.aiode.entities.AccessConfiguration)

Example 2 with QueryBuilderFactory

use of net.robinfriedli.aiode.persist.qb.QueryBuilderFactory in project aiode by robinfriedli.

the class GuildManager method getActiveGuilds.

/**
 * Return guilds that are active now (playing music) or were active withing the specified amount of milliseconds
 * (by entering a command or listening a song).
 *
 * @param session the hibernate session
 * @param delayMs the maximum amount of time since the last action for a guild to be considered active in milliseconds
 * @return all active guilds
 */
public Set<Guild> getActiveGuilds(Session session, long delayMs) {
    Aiode aiode = Aiode.get();
    ShardManager shardManager = aiode.getShardManager();
    QueryBuilderFactory queryBuilderFactory = aiode.getQueryBuilderFactory();
    Set<Guild> activeGuilds = Sets.newHashSet();
    Set<String> activeGuildIds = Sets.newHashSet();
    if (ExecutionContext.Current.isSet()) {
        activeGuilds.add(ExecutionContext.Current.require().getGuild());
    }
    for (Guild guild : shardManager.getGuilds()) {
        AudioPlayback playback = audioManager.getPlaybackForGuild(guild);
        if (playback.isPlaying()) {
            activeGuilds.add(guild);
        }
    }
    long startMillis = System.currentTimeMillis() - delayMs;
    Set<String> recentCommandGuildIds = queryBuilderFactory.select(CommandHistory.class, "guildId", String.class).where((cb, root) -> cb.greaterThan(root.get("startMillis"), startMillis)).build(session).getResultStream().collect(Collectors.toSet());
    activeGuildIds.addAll(recentCommandGuildIds);
    LocalDateTime dateTime10MinutesAgo = LocalDateTime.ofInstant(Instant.ofEpochMilli(startMillis), ZoneId.systemDefault());
    Set<String> recentPlaybackGuildIds = queryBuilderFactory.select(PlaybackHistory.class, "guildId", String.class).where((cb, root) -> cb.greaterThan(root.get("timestamp"), dateTime10MinutesAgo)).build(session).getResultStream().collect(Collectors.toSet());
    activeGuildIds.addAll(recentPlaybackGuildIds);
    for (String guildId : activeGuildIds) {
        Guild guild = shardManager.getGuildById(guildId);
        if (guild != null) {
            activeGuilds.add(guild);
        }
    }
    return activeGuilds;
}
Also used : AudioPlayer(com.sedmelluq.discord.lavaplayer.player.AudioPlayer) PlaylistItemTimestampInterceptor(net.robinfriedli.aiode.persist.interceptors.PlaylistItemTimestampInterceptor) PlaybackHistory(net.robinfriedli.aiode.entities.PlaybackHistory) JxpBackend(net.robinfriedli.jxp.api.JxpBackend) LoggerFactory(org.slf4j.LoggerFactory) Member(net.dv8tion.jda.api.entities.Member) TextChannel(net.dv8tion.jda.api.entities.TextChannel) HibernatePlaylistMigrator(net.robinfriedli.aiode.persist.tasks.HibernatePlaylistMigrator) ExecutionContext(net.robinfriedli.aiode.concurrent.ExecutionContext) Guild(net.dv8tion.jda.api.entities.Guild) GuildSpecification(net.robinfriedli.aiode.entities.GuildSpecification) Playlist(net.robinfriedli.aiode.entities.Playlist) Map(java.util.Map) Resource(org.springframework.core.io.Resource) EmbedDocumentContribution(net.robinfriedli.aiode.entities.xml.EmbedDocumentContribution) CommandManager(net.robinfriedli.aiode.command.CommandManager) AudioPlayback(net.robinfriedli.aiode.audio.AudioPlayback) SessionFactory(org.hibernate.SessionFactory) Set(java.util.Set) AudioManager(net.robinfriedli.aiode.audio.AudioManager) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) ZoneId(java.time.ZoneId) Sets(com.google.common.collect.Sets) List(java.util.List) AccessConfiguration(net.robinfriedli.aiode.entities.AccessConfiguration) SnowflakeMap(net.robinfriedli.aiode.util.SnowflakeMap) Optional(java.util.Optional) InterceptorChain(net.robinfriedli.aiode.persist.interceptors.InterceptorChain) HibernateComponent(net.robinfriedli.aiode.boot.configurations.HibernateComponent) PlaylistItem(net.robinfriedli.aiode.entities.PlaylistItem) MessageChannel(net.dv8tion.jda.api.entities.MessageChannel) AbstractGuildProperty(net.robinfriedli.aiode.discord.property.AbstractGuildProperty) LocalDateTime(java.time.LocalDateTime) Session(org.hibernate.Session) MutexSync(net.robinfriedli.exec.MutexSync) Value(org.springframework.beans.factory.annotation.Value) Strings(com.google.common.base.Strings) QueryBuilderFactory(net.robinfriedli.aiode.persist.qb.QueryBuilderFactory) GuildPropertyManager(net.robinfriedli.aiode.discord.property.GuildPropertyManager) SearchEngine(net.robinfriedli.aiode.util.SearchEngine) CommandContribution(net.robinfriedli.aiode.entities.xml.CommandContribution) Nullable(javax.annotation.Nullable) VerifyPlaylistInterceptor(net.robinfriedli.aiode.persist.interceptors.VerifyPlaylistInterceptor) Context(net.robinfriedli.jxp.persist.Context) Logger(org.slf4j.Logger) ShardManager(net.dv8tion.jda.api.sharding.ShardManager) CommandHistory(net.robinfriedli.aiode.entities.CommandHistory) IOException(java.io.IOException) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) Conditions(net.robinfriedli.jxp.queries.Conditions) HibernateInvoker(net.robinfriedli.aiode.function.HibernateInvoker) Aiode(net.robinfriedli.aiode.Aiode) SpotifyApi(se.michaelthelin.spotify.SpotifyApi) Component(org.springframework.stereotype.Component) LocalDateTime(java.time.LocalDateTime) QueryBuilderFactory(net.robinfriedli.aiode.persist.qb.QueryBuilderFactory) AudioPlayback(net.robinfriedli.aiode.audio.AudioPlayback) ShardManager(net.dv8tion.jda.api.sharding.ShardManager) Guild(net.dv8tion.jda.api.entities.Guild) Aiode(net.robinfriedli.aiode.Aiode)

Example 3 with QueryBuilderFactory

use of net.robinfriedli.aiode.persist.qb.QueryBuilderFactory in project aiode by robinfriedli.

the class Artist method getOrCreateArtist.

/**
 * Get the existing artist with the provided or create a new artist. This method runs synchronised on the artist id
 * to avoid unique constraint violations during concurrent creation.
 *
 * @param artist  the spotify artist
 * @param session the hibernate session
 */
public static Artist getOrCreateArtist(ArtistSimplified artist, Session session) {
    QueryBuilderFactory queryBuilderFactory = Aiode.get().getQueryBuilderFactory();
    Mode mode = Mode.create().with(new MutexSyncMode<>(artist.getId(), ARTIST_SYNC));
    return HibernateInvoker.create(session).invokeFunction(mode, currentSession -> {
        Optional<Artist> existingArtist = queryBuilderFactory.find(Artist.class).where((cb, root) -> cb.equal(root.get("id"), artist.getId())).build(currentSession).uniqueResultOptional();
        return existingArtist.orElseGet(() -> {
            Artist newArtist = new Artist(artist.getId(), artist.getName());
            currentSession.persist(newArtist);
            currentSession.flush();
            return newArtist;
        });
    });
}
Also used : QueryBuilderFactory(net.robinfriedli.aiode.persist.qb.QueryBuilderFactory) Mode(net.robinfriedli.exec.Mode) MutexSyncMode(net.robinfriedli.exec.modes.MutexSyncMode)

Example 4 with QueryBuilderFactory

use of net.robinfriedli.aiode.persist.qb.QueryBuilderFactory in project aiode by robinfriedli.

the class ChartsCommand method doRun.

@Override
public void doRun() {
    Session session = getContext().getSession();
    Guild guild = getContext().getGuild();
    QueryBuilderFactory queryBuilderFactory = getQueryBuilderFactory();
    LocalDateTime startOfMonth = LocalDate.now().withDayOfMonth(1).atStartOfDay();
    Date dateAtStartOfMonth = Date.valueOf(startOfMonth.toLocalDate());
    SelectQueryBuilder<PlaybackHistory> trackChartsQuery = queryBuilderFactory.select(PlaybackHistory.class, (from, cb) -> from.get("fkSource"), (from, cb) -> from.get("trackId"), (from, cb) -> cb.count(from.get("pk")), (from, cb) -> from.get("fkSpotifyItemKind")).where((cb, root) -> cb.isNotNull(root.get("trackId"))).groupBySeveral((from, cb) -> Lists.newArrayList(from.get("trackId"), from.get("fkSource"), from.get("fkSpotifyItemKind"))).orderBy((from, cb) -> cb.desc(cb.count(from.get("pk"))));
    SelectQueryBuilder<PlaybackHistory> trackChartsQueryGuild = trackChartsQuery.fork().where((cb, root) -> cb.equal(root.get("guildId"), guild.getId()));
    SelectQueryBuilder<PlaybackHistory> trackChartsQueryMonthly = trackChartsQuery.fork().where((cb, root) -> cb.greaterThan(root.get("timestamp"), startOfMonth));
    SelectQueryBuilder<PlaybackHistory> trackChartsQueryMonthlyGuild = trackChartsQueryMonthly.fork().where((cb, root) -> cb.equal(root.get("guildId"), guild.getId()));
    Query<Object[]> globalQuery = trackChartsQuery.build(session).setMaxResults(5);
    Query<Object[]> guildQuery = trackChartsQueryGuild.build(session).setMaxResults(5);
    Query<Object[]> globalQueryMonthly = trackChartsQueryMonthly.build(session).setMaxResults(5);
    Query<Object[]> guildQueryMonthly = trackChartsQueryMonthlyGuild.build(session).setMaxResults(5);
    List<Object[]> globalResults = globalQuery.getResultList();
    List<Object[]> guildResults = guildQuery.getResultList();
    List<Object[]> globalMonthlyResults = globalQueryMonthly.getResultList();
    List<Object[]> guildMonthlyResults = guildQueryMonthly.getResultList();
    @SuppressWarnings("unchecked") Query<Object[]> globalArtistQuery = session.createSQLQuery("select artist_pk, count(*) as c " + "from playback_history_artist group by artist_pk order by c desc limit 3");
    @SuppressWarnings("unchecked") Query<Object[]> guildArtistQuery = session.createSQLQuery("select artist_pk, count(*) as c from " + "playback_history_artist as p where p.playback_history_pk in(select pk from playback_history where guild_id = ?) " + "group by artist_pk order by c desc limit 3");
    guildArtistQuery.setParameter(1, guild.getId());
    @SuppressWarnings("unchecked") Query<Object[]> globalArtistMonthlyQuery = session.createSQLQuery("select artist_pk, count(*) as c " + "from playback_history_artist as p " + "where p.playback_history_pk in(select pk from playback_history where timestamp > ?) " + "group by artist_pk order by c desc limit 3");
    globalArtistMonthlyQuery.setParameter(1, dateAtStartOfMonth);
    @SuppressWarnings("unchecked") Query<Object[]> guildArtistMonthlyQuery = session.createSQLQuery("select artist_pk, count(*) as c " + "from playback_history_artist where playback_history_pk in(select pk from playback_history " + "where timestamp > ? and guild_id = ?) " + "group by artist_pk order by c desc limit 3");
    guildArtistMonthlyQuery.setParameter(1, dateAtStartOfMonth);
    guildArtistMonthlyQuery.setParameter(2, guild.getId());
    List<Object[]> globalArtists = globalArtistQuery.getResultList();
    List<Object[]> guildArtists = guildArtistQuery.getResultList();
    List<Object[]> globalArtistsMonthly = globalArtistMonthlyQuery.getResultList();
    List<Object[]> guildArtistMonthly = guildArtistMonthlyQuery.getResultList();
    EmbedBuilder embedBuilder = new EmbedBuilder();
    embedBuilder.addField("Global", "Shows the charts across all guilds", false);
    addTrackCharts(globalResults, embedBuilder, "All time", session);
    addArtists(globalArtists, embedBuilder, "All time");
    embedBuilder.addBlankField(true);
    addTrackCharts(globalMonthlyResults, embedBuilder, "Monthly", session);
    addArtists(globalArtistsMonthly, embedBuilder, "Monthly");
    embedBuilder.addBlankField(false);
    embedBuilder.addField("Guild", "Shows the charts for this guild", false);
    addTrackCharts(guildResults, embedBuilder, "All time", session);
    addArtists(guildArtists, embedBuilder, "All time");
    embedBuilder.addBlankField(true);
    addTrackCharts(guildMonthlyResults, embedBuilder, "Monthly", session);
    addArtists(guildArtistMonthly, embedBuilder, "Monthly");
    sendMessage(embedBuilder);
}
Also used : LocalDateTime(java.time.LocalDateTime) Artist(net.robinfriedli.aiode.entities.Artist) PlayableFactory(net.robinfriedli.aiode.audio.PlayableFactory) PlaybackHistory(net.robinfriedli.aiode.entities.PlaybackHistory) LocalDateTime(java.time.LocalDateTime) LoggerFactory(org.slf4j.LoggerFactory) SpotifyTrack(net.robinfriedli.aiode.audio.spotify.SpotifyTrack) Playable(net.robinfriedli.aiode.audio.Playable) Session(org.hibernate.Session) HashMap(java.util.HashMap) PlayableTrackWrapper(net.robinfriedli.aiode.audio.spotify.PlayableTrackWrapper) PlaybackHistorySource(net.robinfriedli.aiode.entities.PlaybackHistorySource) QueryBuilderFactory(net.robinfriedli.aiode.persist.qb.QueryBuilderFactory) Util(net.robinfriedli.aiode.util.Util) Lists(com.google.common.collect.Lists) Guild(net.dv8tion.jda.api.entities.Guild) Map(java.util.Map) Query(org.hibernate.query.Query) BigInteger(java.math.BigInteger) CommandContribution(net.robinfriedli.aiode.entities.xml.CommandContribution) FriendlyException(com.sedmelluq.discord.lavaplayer.tools.FriendlyException) CommandManager(net.robinfriedli.aiode.command.CommandManager) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) SpotifyItemKind(net.robinfriedli.aiode.entities.SpotifyItemKind) SpotifyTrackKind(net.robinfriedli.aiode.audio.spotify.SpotifyTrackKind) Date(java.sql.Date) Aiode(net.robinfriedli.aiode.Aiode) SelectQueryBuilder(net.robinfriedli.aiode.persist.qb.builders.SelectQueryBuilder) List(java.util.List) AbstractCommand(net.robinfriedli.aiode.command.AbstractCommand) SpotifyService(net.robinfriedli.aiode.audio.spotify.SpotifyService) CommandContext(net.robinfriedli.aiode.command.CommandContext) LocalDate(java.time.LocalDate) BlockingTrackLoadingExecutor(net.robinfriedli.aiode.audio.exec.BlockingTrackLoadingExecutor) YouTubeService(net.robinfriedli.aiode.audio.youtube.YouTubeService) QueryBuilderFactory(net.robinfriedli.aiode.persist.qb.QueryBuilderFactory) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) PlaybackHistory(net.robinfriedli.aiode.entities.PlaybackHistory) Guild(net.dv8tion.jda.api.entities.Guild) Date(java.sql.Date) LocalDate(java.time.LocalDate) Session(org.hibernate.Session)

Example 5 with QueryBuilderFactory

use of net.robinfriedli.aiode.persist.qb.QueryBuilderFactory in project aiode by robinfriedli.

the class ConnectCommand method awaitPrivateMessage.

private void awaitPrivateMessage(ClientSession clientSession, long userId, Guild guild, User user, int attemptNumber) {
    CompletableFuture<PrivateMessageReceivedEvent> futurePrivateMessage = getManager().getEventWaiter().awaitEvent(PrivateMessageReceivedEvent.class, event -> event.getAuthor().getIdLong() == userId).orTimeout(1, TimeUnit.MINUTES);
    CompletableFutures.handleWhenComplete(futurePrivateMessage, (event, error) -> {
        try {
            MessageService messageService = getMessageService();
            if (event != null) {
                String token = event.getMessage().getContentRaw();
                UUID sessionId;
                try {
                    sessionId = UUID.fromString(token);
                } catch (IllegalArgumentException e) {
                    String message = String.format("'%s' is not a valid token. ", token);
                    if (attemptNumber >= RETRY_COUNT) {
                        messageService.sendError(message + "Maximum retry count reached.", user);
                    } else {
                        messageService.sendError(message + String.format("Attempt %d / %d", attemptNumber, RETRY_COUNT), user);
                        awaitPrivateMessage(clientSession, userId, guild, user, attemptNumber + 1);
                    }
                    return;
                }
                QueryBuilderFactory queryBuilderFactory = getQueryBuilderFactory();
                MutexSyncMode<UUID> mutexSyncMode = new MutexSyncMode<>(sessionId, TOKEN_SYNC);
                HibernateInvoker.create().invokeConsumer(Mode.create().with(mutexSyncMode), session -> {
                    Optional<GeneratedToken> foundGeneratedToken = queryBuilderFactory.find(GeneratedToken.class).where((cb, root) -> cb.equal(root.get("token"), sessionId)).build(session).uniqueResultOptional();
                    if (foundGeneratedToken.isEmpty()) {
                        String message = "Token is invalid. Make sure it matches the token generated by your web client. Tokens may not be shared or reused. ";
                        if (attemptNumber >= RETRY_COUNT) {
                            messageService.sendError(message + "Maximum retry count reached.", user);
                        } else {
                            messageService.sendError(message + String.format("Attempt %d / %d", attemptNumber, RETRY_COUNT), user);
                            awaitPrivateMessage(clientSession, userId, guild, user, attemptNumber + 1);
                        }
                        return;
                    }
                    GeneratedToken generatedToken = foundGeneratedToken.get();
                    Long existingSessionCount = queryBuilderFactory.select(ClientSession.class, (from, cb) -> cb.count(from.get("pk")), Long.class).where((cb, root) -> cb.equal(root.get("sessionId"), sessionId)).build(session).uniqueResult();
                    if (existingSessionCount > 0) {
                        messageService.sendError("A session with this ID already exists. You are probably already signed in, try reloading your web client. If your client still can't sign in try generating a new token using the reload button and then try the connect command again.", user);
                        return;
                    }
                    clientSession.setLastRefresh(LocalDateTime.now());
                    clientSession.setSessionId(sessionId);
                    clientSession.setIpAddress(generatedToken.getIp());
                    session.persist(clientSession);
                    session.delete(generatedToken);
                    messageService.sendSuccess(String.format("Okay, a session connected to guild '%s' " + "has been prepared. You may return to the web client to complete the setup. The client should " + "connect automatically, else you can continue manually.", guild.getName()), user);
                });
            } else if (error != null) {
                if (error instanceof TimeoutException) {
                    messageService.sendError("Your connection attempt timed out", user);
                } else {
                    EmbedBuilder exceptionEmbed = ExceptionUtils.buildErrorEmbed(error);
                    exceptionEmbed.setTitle("Exception");
                    exceptionEmbed.setDescription("There has been an error awaiting private message to establish connection");
                    LoggerFactory.getLogger(getClass()).error("unexpected exception while awaiting private message", error);
                    sendMessage(exceptionEmbed.build());
                }
                setFailed(true);
            }
        } finally {
            USERS_WITH_PENDING_CONNECTION.remove(userId);
        }
    }, e -> {
        LoggerFactory.getLogger(getClass()).error("Unexpected error in whenComplete of event handler", e);
        EmbedBuilder embedBuilder = ExceptionUtils.buildErrorEmbed(e).setTitle("Exception").setDescription("There has been an unexpected exception while trying to establish the connection");
        getMessageService().send(embedBuilder.build(), user);
    });
}
Also used : LocalDateTime(java.time.LocalDateTime) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) CompletableFuture(java.util.concurrent.CompletableFuture) MutexSync(net.robinfriedli.exec.MutexSync) User(net.dv8tion.jda.api.entities.User) QueryBuilderFactory(net.robinfriedli.aiode.persist.qb.QueryBuilderFactory) Guild(net.dv8tion.jda.api.entities.Guild) Map(java.util.Map) CompletableFutures(net.robinfriedli.aiode.concurrent.CompletableFutures) CommandContribution(net.robinfriedli.aiode.entities.xml.CommandContribution) ClientSession(net.robinfriedli.aiode.entities.ClientSession) CommandManager(net.robinfriedli.aiode.command.CommandManager) Mode(net.robinfriedli.exec.Mode) MessageService(net.robinfriedli.aiode.discord.MessageService) InvalidCommandException(net.robinfriedli.aiode.exceptions.InvalidCommandException) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) PrivateMessageReceivedEvent(net.dv8tion.jda.api.events.message.priv.PrivateMessageReceivedEvent) UUID(java.util.UUID) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) HibernateInvoker(net.robinfriedli.aiode.function.HibernateInvoker) TimeUnit(java.util.concurrent.TimeUnit) AbstractCommand(net.robinfriedli.aiode.command.AbstractCommand) CommandContext(net.robinfriedli.aiode.command.CommandContext) GeneratedToken(net.robinfriedli.aiode.entities.GeneratedToken) Optional(java.util.Optional) MutexSyncMode(net.robinfriedli.exec.modes.MutexSyncMode) ExceptionUtils(net.robinfriedli.aiode.exceptions.ExceptionUtils) PrivateMessageReceivedEvent(net.dv8tion.jda.api.events.message.priv.PrivateMessageReceivedEvent) MessageService(net.robinfriedli.aiode.discord.MessageService) QueryBuilderFactory(net.robinfriedli.aiode.persist.qb.QueryBuilderFactory) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) MutexSyncMode(net.robinfriedli.exec.modes.MutexSyncMode) GeneratedToken(net.robinfriedli.aiode.entities.GeneratedToken) ClientSession(net.robinfriedli.aiode.entities.ClientSession) UUID(java.util.UUID) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

QueryBuilderFactory (net.robinfriedli.aiode.persist.qb.QueryBuilderFactory)10 Aiode (net.robinfriedli.aiode.Aiode)5 Session (org.hibernate.Session)5 List (java.util.List)4 Optional (java.util.Optional)4 EmbedBuilder (net.dv8tion.jda.api.EmbedBuilder)4 Guild (net.dv8tion.jda.api.entities.Guild)4 CommandContext (net.robinfriedli.aiode.command.CommandContext)4 CommandManager (net.robinfriedli.aiode.command.CommandManager)4 CommandContribution (net.robinfriedli.aiode.entities.xml.CommandContribution)4 LocalDateTime (java.time.LocalDateTime)3 Map (java.util.Map)3 Nullable (javax.annotation.Nullable)3 AbstractCommand (net.robinfriedli.aiode.command.AbstractCommand)3 StoredScript (net.robinfriedli.aiode.entities.StoredScript)3 LoggerFactory (org.slf4j.LoggerFactory)3 Lists (com.google.common.collect.Lists)2 ShardManager (net.dv8tion.jda.api.sharding.ShardManager)2 AccessConfiguration (net.robinfriedli.aiode.entities.AccessConfiguration)2 GuildSpecification (net.robinfriedli.aiode.entities.GuildSpecification)2