Search in sources :

Example 1 with MessageBulkDeleteEvent

use of net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent in project SkyBot by duncte123.

the class MessageListener method onMessageBulkDelete.

@SuppressWarnings("PMD.UseConcurrentHashMap")
protected void onMessageBulkDelete(final MessageBulkDeleteEvent event) {
    this.handlerThread.submit(() -> {
        try {
            final DunctebotGuild guild = new DunctebotGuild(event.getGuild(), variables);
            if (!guild.getSettings().isMessageLogging()) {
                // just delete the message here as we don't want to keep it around
                this.redis.deleteMessages(event.getMessageIds());
                return;
            }
            final List<MessageData> dataList = this.redis.getAndDeleteMessages(event.getMessageIds());
            final StringBuilder builder = new StringBuilder();
            // temporarily store the users to prevent spamming discord for the data
            final Map<Long, User> tmpUsers = new HashMap<>();
            final JDA jda = event.getJDA();
            // reverse the list to preserve the correct order
            Collections.reverse(dataList);
            for (final MessageData data : dataList) {
                final long authorId = data.getAuthorId();
                final Consumer<User> userConsumer = (user) -> {
                    builder.append('[').append(data.getCratedAt().format(DateTimeFormatter.RFC_1123_DATE_TIME)).append("] (").append(user.getAsTag()).append(" - ").append(user.getIdLong()).append(") [").append(data.getMessageId()).append("]: ").append(data.getContent()).append('\n');
                };
                if (tmpUsers.containsKey(authorId)) {
                    userConsumer.accept(tmpUsers.get(authorId));
                } else {
                    // try to fetch the user since we don't cache them
                    // calls are sequential making sure the messages are still in order
                    jda.retrieveUserById(authorId).queue((user) -> {
                        tmpUsers.put(authorId, user);
                        userConsumer.accept(user);
                    }, (error) -> userConsumer.accept(new UnknownUser(authorId)));
                }
            }
            final TextChannel channel = event.getChannel();
            final EmbedBuilder embed = EmbedUtils.embedField("Bulk Delete", "Bulk deleted messages from <#%s> are available in the attached file.".formatted(channel.getIdLong())).setColor(0xE67E22).setTimestamp(Instant.now());
            modLog(new MessageConfig.Builder().addEmbed(true, embed).setActionConfig((action) -> action.addFile(builder.toString().getBytes(), "bulk_delete_%s.txt".formatted(System.currentTimeMillis()))), guild);
        } catch (Exception e) {
            LOGGER.error("Exception on message bulk delete", e);
        }
    });
}
Also used : MessageData(ml.duncte123.skybot.objects.discord.MessageData) MessageBulkDeleteEvent(net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent) EmbedUtils(me.duncte123.botcommons.messaging.EmbedUtils) StringUtils(me.duncte123.botcommons.StringUtils) Permission(net.dv8tion.jda.api.Permission) CommandCategory(ml.duncte123.skybot.objects.command.CommandCategory) PerspectiveApi(ml.duncte123.skybot.utils.PerspectiveApi) UNKNOWN_MESSAGE(net.dv8tion.jda.api.requests.ErrorResponse.UNKNOWN_MESSAGE) SpamFilter(ml.duncte123.skybot.utils.SpamFilter) Matcher(java.util.regex.Matcher) GuildSettingsUtils(ml.duncte123.skybot.utils.GuildSettingsUtils) GuildMessageReceivedEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent) GuildSetting(com.dunctebot.models.settings.GuildSetting) GuildMessageUpdateEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageUpdateEvent) Variables(ml.duncte123.skybot.Variables) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) Executors(java.util.concurrent.Executors) UnknownUser(ml.duncte123.skybot.objects.user.UnknownUser) Pattern(java.util.regex.Pattern) MISSING_PERMISSIONS(net.dv8tion.jda.api.requests.ErrorResponse.MISSING_PERMISSIONS) ICommand(ml.duncte123.skybot.objects.command.ICommand) net.dv8tion.jda.api.entities(net.dv8tion.jda.api.entities) BotCommons(me.duncte123.botcommons.BotCommons) java.util(java.util) JDA(net.dv8tion.jda.api.JDA) MarkdownSanitizer(net.dv8tion.jda.api.utils.MarkdownSanitizer) CustomCommand(ml.duncte123.skybot.objects.command.custom.CustomCommand) GuildMessageDeleteEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageDeleteEvent) MessageUtils(me.duncte123.botcommons.messaging.MessageUtils) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Sentry(io.sentry.Sentry) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) ErrorHandler(net.dv8tion.jda.api.exceptions.ErrorHandler) GenericGuildMessageEvent(net.dv8tion.jda.api.events.message.guild.GenericGuildMessageEvent) CommandUtils.isGuildPatron(ml.duncte123.skybot.utils.CommandUtils.isGuildPatron) ShardManager(net.dv8tion.jda.api.sharding.ShardManager) MessageUtils.sendMsg(me.duncte123.botcommons.messaging.MessageUtils.sendMsg) CommandContext(ml.duncte123.skybot.objects.command.CommandContext) CommandUtils.isDev(ml.duncte123.skybot.utils.CommandUtils.isDev) ModerationUtils.modLog(ml.duncte123.skybot.utils.ModerationUtils.modLog) CommandManager(ml.duncte123.skybot.CommandManager) DunctebotGuild(ml.duncte123.skybot.entities.jda.DunctebotGuild) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) AirUtils.setJDAContext(ml.duncte123.skybot.utils.AirUtils.setJDAContext) Triple(kotlin.Triple) Settings(ml.duncte123.skybot.Settings) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) MessageConfig(me.duncte123.botcommons.messaging.MessageConfig) RedisConnection(ml.duncte123.skybot.database.RedisConnection) DateTimeFormatter(java.time.format.DateTimeFormatter) UnknownUser(ml.duncte123.skybot.objects.user.UnknownUser) UnknownUser(ml.duncte123.skybot.objects.user.UnknownUser) MessageData(ml.duncte123.skybot.objects.discord.MessageData) JDA(net.dv8tion.jda.api.JDA) DunctebotGuild(ml.duncte123.skybot.entities.jda.DunctebotGuild) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) MessageConfig(me.duncte123.botcommons.messaging.MessageConfig)

Example 2 with MessageBulkDeleteEvent

use of net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent in project JDA by DV8FromTheWorld.

the class MessageBulkDeleteHandler method handleInternally.

@Override
protected Long handleInternally(DataObject content) {
    if (!content.isNull("guild_id")) {
        long guildId = content.getLong("guild_id");
        if (getJDA().getGuildSetupController().isLocked(guildId))
            return guildId;
    }
    final long channelId = content.getLong("channel_id");
    if (getJDA().isBulkDeleteSplittingEnabled()) {
        SocketHandler handler = getJDA().getClient().getHandlers().get("MESSAGE_DELETE");
        content.getArray("ids").forEach(id -> {
            handler.handle(responseNumber, DataObject.empty().put("t", "MESSAGE_DELETE").put("d", DataObject.empty().put("channel_id", Long.toUnsignedString(channelId)).put("id", id)));
        });
    } else {
        // TODO-v5-unified-channel-cache
        GuildMessageChannel channel = getJDA().getTextChannelById(channelId);
        if (channel == null)
            channel = getJDA().getNewsChannelById(channelId);
        if (channel == null)
            channel = getJDA().getThreadChannelById(channelId);
        if (channel == null) {
            getJDA().getEventCache().cache(EventCache.Type.CHANNEL, channelId, responseNumber, allContent, this::handle);
            EventCache.LOG.debug("Received a Bulk Message Delete for a GuildMessageChannel that is not yet cached.");
            return null;
        }
        if (getJDA().getGuildSetupController().isLocked(channel.getGuild().getIdLong()))
            return channel.getGuild().getIdLong();
        DataArray array = content.getArray("ids");
        List<String> messages = array.stream(DataArray::getString).collect(Collectors.toList());
        getJDA().handleEvent(new MessageBulkDeleteEvent(getJDA(), responseNumber, channel, messages));
    }
    return null;
}
Also used : MessageBulkDeleteEvent(net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent) DataArray(net.dv8tion.jda.api.utils.data.DataArray) GuildMessageChannel(net.dv8tion.jda.api.entities.GuildMessageChannel)

Example 3 with MessageBulkDeleteEvent

use of net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent in project Sx4 by sx4-discord-bot.

the class LoggerHandler method onMessageBulkDelete.

public void onMessageBulkDelete(MessageBulkDeleteEvent event) {
    List<String> messageIds = event.getMessageIds();
    TextChannel textChannel = event.getChannel();
    Guild guild = event.getGuild();
    LoggerEvent loggerEvent = LoggerEvent.MESSAGE_DELETE;
    this.bot.getMongo().aggregateLoggers(this.getPipeline(guild.getIdLong())).whenComplete((documents, exception) -> {
        if (ExceptionUtility.sendErrorMessage(exception)) {
            return;
        }
        if (documents.isEmpty()) {
            return;
        }
        Document data = documents.get(0);
        if (guild.getSelfMember().hasPermission(Permission.VIEW_AUDIT_LOGS)) {
            this.retrieveAuditLogsDelayed(guild, ActionType.MESSAGE_BULK_DELETE).whenComplete((logs, auditException) -> {
                this.messageCache.putIfAbsent(guild.getIdLong(), new TLongIntHashMap());
                TLongIntMap guildCache = this.messageCache.get(guild.getIdLong());
                AuditLogEntry entry = logs == null ? null : logs.stream().filter(e -> Duration.between(e.getTimeCreated(), ZonedDateTime.now(ZoneOffset.UTC)).toMinutes() <= 5).filter(e -> {
                    int count = Integer.parseInt(e.getOptionByName("count"));
                    int oldCount = guildCache.get(e.getIdLong());
                    guildCache.put(e.getIdLong(), count);
                    return (count == messageIds.size() && count != oldCount) || count > oldCount;
                }).findFirst().orElse(null);
                this.handleBulkMessages(textChannel, messageIds, data.getList("loggers", Document.class), loggerEvent, entry == null ? null : entry.getUser());
            });
            return;
        }
        this.handleBulkMessages(textChannel, messageIds, data.getList("loggers", Document.class), loggerEvent, null);
    });
}
Also used : TLongIntMap(gnu.trove.map.TLongIntMap) MessageBulkDeleteEvent(net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent) Document(org.bson.Document) PermissionOverrideCreateEvent(net.dv8tion.jda.api.events.guild.override.PermissionOverrideCreateEvent) RoleCreateEvent(net.dv8tion.jda.api.events.role.RoleCreateEvent) StoreChannelDeleteEvent(net.dv8tion.jda.api.events.channel.store.StoreChannelDeleteEvent) Permission(net.dv8tion.jda.api.Permission) ZonedDateTime(java.time.ZonedDateTime) Aggregates(com.mongodb.client.model.Aggregates) EmoteUpdateRolesEvent(net.dv8tion.jda.api.events.emote.update.EmoteUpdateRolesEvent) AuditLogChange(net.dv8tion.jda.api.audit.AuditLogChange) CategoryCreateEvent(net.dv8tion.jda.api.events.channel.category.CategoryCreateEvent) LoggerManager(com.sx4.bot.managers.LoggerManager) ColourUtility(com.sx4.bot.utility.ColourUtility) TextChannelDeleteEvent(net.dv8tion.jda.api.events.channel.text.TextChannelDeleteEvent) EmoteAddedEvent(net.dv8tion.jda.api.events.emote.EmoteAddedEvent) TextChannelUpdateNameEvent(net.dv8tion.jda.api.events.channel.text.update.TextChannelUpdateNameEvent) TextChannelCreateEvent(net.dv8tion.jda.api.events.channel.text.TextChannelCreateEvent) Duration(java.time.Duration) GenericEvent(net.dv8tion.jda.api.events.GenericEvent) ZoneOffset(java.time.ZoneOffset) LoggerContext(com.sx4.bot.entities.management.LoggerContext) LoggerEvent(com.sx4.bot.entities.management.LoggerEvent) AuditLogKey(net.dv8tion.jda.api.audit.AuditLogKey) PermissionOverrideDeleteEvent(net.dv8tion.jda.api.events.guild.override.PermissionOverrideDeleteEvent) EmbedFooter(club.minnced.discord.webhook.send.WebhookEmbed.EmbedFooter) GuildMessageUpdateEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageUpdateEvent) java.util.concurrent(java.util.concurrent) EmoteUpdateNameEvent(net.dv8tion.jda.api.events.emote.update.EmoteUpdateNameEvent) CategoryDeleteEvent(net.dv8tion.jda.api.events.channel.category.CategoryDeleteEvent) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) GuildBanEvent(net.dv8tion.jda.api.events.guild.GuildBanEvent) GuildMemberRemoveEvent(net.dv8tion.jda.api.events.guild.member.GuildMemberRemoveEvent) EventListener(net.dv8tion.jda.api.hooks.EventListener) CategoryUpdateNameEvent(net.dv8tion.jda.api.events.channel.category.update.CategoryUpdateNameEvent) GuildMemberUpdateNicknameEvent(net.dv8tion.jda.api.events.guild.member.update.GuildMemberUpdateNicknameEvent) NotNull(org.jetbrains.annotations.NotNull) RoleUpdateColorEvent(net.dv8tion.jda.api.events.role.update.RoleUpdateColorEvent) ActionType(net.dv8tion.jda.api.audit.ActionType) net.dv8tion.jda.api.entities(net.dv8tion.jda.api.entities) VoiceChannelUpdateNameEvent(net.dv8tion.jda.api.events.channel.voice.update.VoiceChannelUpdateNameEvent) java.util(java.util) JDA(net.dv8tion.jda.api.JDA) EmbedAuthor(club.minnced.discord.webhook.send.WebhookEmbed.EmbedAuthor) GuildMemberRoleRemoveEvent(net.dv8tion.jda.api.events.guild.member.GuildMemberRoleRemoveEvent) RoleUpdatePermissionsEvent(net.dv8tion.jda.api.events.role.update.RoleUpdatePermissionsEvent) VoiceChannelDeleteEvent(net.dv8tion.jda.api.events.channel.voice.VoiceChannelDeleteEvent) Projections(com.mongodb.client.model.Projections) MongoDatabase(com.sx4.bot.database.mongo.MongoDatabase) TLongIntHashMap(gnu.trove.map.hash.TLongIntHashMap) EmbedField(club.minnced.discord.webhook.send.WebhookEmbed.EmbedField) AuditLogEntry(net.dv8tion.jda.api.audit.AuditLogEntry) Filters(com.mongodb.client.model.Filters) GuildMessageDeleteEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageDeleteEvent) Bson(org.bson.conversions.Bson) Pair(net.dv8tion.jda.internal.utils.tuple.Pair) WebhookEmbedBuilder(club.minnced.discord.webhook.send.WebhookEmbedBuilder) Sx4(com.sx4.bot.core.Sx4) GuildMemberRoleAddEvent(net.dv8tion.jda.api.events.guild.member.GuildMemberRoleAddEvent) WebhookEmbed(club.minnced.discord.webhook.send.WebhookEmbed) EmoteRemovedEvent(net.dv8tion.jda.api.events.emote.EmoteRemovedEvent) Operators(com.sx4.bot.database.mongo.model.Operators) Accumulators(com.mongodb.client.model.Accumulators) TLongIntMap(gnu.trove.map.TLongIntMap) VoiceChannelCreateEvent(net.dv8tion.jda.api.events.channel.voice.VoiceChannelCreateEvent) LoggerUtility(com.sx4.bot.utility.LoggerUtility) RoleUpdateNameEvent(net.dv8tion.jda.api.events.role.update.RoleUpdateNameEvent) StoreChannelUpdateNameEvent(net.dv8tion.jda.api.events.channel.store.update.StoreChannelUpdateNameEvent) TLongObjectHashMap(gnu.trove.map.hash.TLongObjectHashMap) OkHttpClient(okhttp3.OkHttpClient) PermissionOverrideUpdateEvent(net.dv8tion.jda.api.events.guild.override.PermissionOverrideUpdateEvent) net.dv8tion.jda.api.events.guild.voice(net.dv8tion.jda.api.events.guild.voice) StoreChannelCreateEvent(net.dv8tion.jda.api.events.channel.store.StoreChannelCreateEvent) GuildMessage(com.sx4.bot.entities.cache.GuildMessage) GuildUnbanEvent(net.dv8tion.jda.api.events.guild.GuildUnbanEvent) TLongObjectMap(gnu.trove.map.TLongObjectMap) RoleDeleteEvent(net.dv8tion.jda.api.events.role.RoleDeleteEvent) ExceptionUtility(com.sx4.bot.utility.ExceptionUtility) StringUtility(com.sx4.bot.utility.StringUtility) GuildMemberJoinEvent(net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent) TLongIntHashMap(gnu.trove.map.hash.TLongIntHashMap) AuditLogEntry(net.dv8tion.jda.api.audit.AuditLogEntry) LoggerEvent(com.sx4.bot.entities.management.LoggerEvent) Document(org.bson.Document)

Example 4 with MessageBulkDeleteEvent

use of net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent in project Gary by help-chat.

the class LoggingHandler method execute.

@Override
protected void execute(GenericEvent event) {
    switch(EventsEnum.fromEvent(event)) {
        case MEMBER_JOIN:
            GuildMemberJoinEvent e = (GuildMemberJoinEvent) event;
            log(EventsEnum.MEMBER_JOIN, e.getJDA(), e.getGuild(), e.getUser());
            break;
        case MEMBER_LEAVE:
            if (!wasBan) {
                GuildMemberLeaveEvent e2 = (GuildMemberLeaveEvent) event;
                log(EventsEnum.MEMBER_LEAVE, e2.getJDA(), e2.getGuild(), e2.getUser());
            } else {
                wasBan = false;
            }
            break;
        case MEMBER_BANNED:
            wasBan = true;
            GuildBanEvent e3 = (GuildBanEvent) event;
            log(EventsEnum.MEMBER_BANNED, e3.getJDA(), e3.getGuild(), e3.getUser());
            break;
        case MESSAGE_EDIT:
            GuildMessageUpdateEvent e5 = (GuildMessageUpdateEvent) event;
            if (!e5.getAuthor().isBot() && StringUtils.equalsIgnoreCase(e5.getChannel().getName(), Constants.CHANNELS)) {
                log(EventsEnum.MESSAGE_EDIT, e5.getJDA(), e5.getGuild(), e5.getAuthor(), e5.getChannel(), e5.getMessage());
            }
            break;
        case MESSAGE_DELETE:
            GuildMessageDeleteEvent e6 = (GuildMessageDeleteEvent) event;
            if ((StringUtils.equalsIgnoreCase(e6.getChannel().getName(), Constants.CHANNELS))) {
                log(EventsEnum.MESSAGE_DELETE, e6.getJDA(), e6.getGuild(), MessageUtils.getAuthor(e6.getMessageIdLong()), e6.getChannel(), e6.getMessageIdLong(), MessageUtils.getMessage(e6.getMessageIdLong()));
            }
            break;
        case MESSAGE_BULK_DELETE:
            MessageBulkDeleteEvent e7 = (MessageBulkDeleteEvent) event;
            if ((StringUtils.equalsIgnoreCase(e7.getChannel().getName(), Constants.CHANNELS))) {
                log(EventsEnum.MESSAGE_BULK_DELETE, e7.getJDA(), e7.getGuild(), e7.getChannel(), e7.getMessageIds());
            }
            break;
        case VOICE_JOIN:
            GuildVoiceJoinEvent e8 = (GuildVoiceJoinEvent) event;
            log(EventsEnum.VOICE_JOIN, e8.getJDA(), e8.getGuild(), e8.getMember().getUser(), e8.getChannelJoined());
            break;
    }
}
Also used : GuildBanEvent(net.dv8tion.jda.api.events.guild.GuildBanEvent) GuildVoiceJoinEvent(net.dv8tion.jda.api.events.guild.voice.GuildVoiceJoinEvent) GuildMemberJoinEvent(net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent) GuildMessageDeleteEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageDeleteEvent) MessageBulkDeleteEvent(net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent) GuildMemberLeaveEvent(net.dv8tion.jda.api.events.guild.member.GuildMemberLeaveEvent) GuildMessageUpdateEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageUpdateEvent)

Example 5 with MessageBulkDeleteEvent

use of net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent in project SkyBot by DuncteBot.

the class MessageListener method onMessageBulkDelete.

@SuppressWarnings("PMD.UseConcurrentHashMap")
protected void onMessageBulkDelete(final MessageBulkDeleteEvent event) {
    this.handlerThread.submit(() -> {
        try {
            final DunctebotGuild guild = new DunctebotGuild(event.getGuild(), variables);
            if (!guild.getSettings().isMessageLogging()) {
                // just delete the message here as we don't want to keep it around
                this.redis.deleteMessages(event.getMessageIds());
                return;
            }
            final List<MessageData> dataList = this.redis.getAndDeleteMessages(event.getMessageIds());
            final StringBuilder builder = new StringBuilder();
            // temporarily store the users to prevent spamming discord for the data
            final Map<Long, User> tmpUsers = new HashMap<>();
            final JDA jda = event.getJDA();
            // reverse the list to preserve the correct order
            Collections.reverse(dataList);
            for (final MessageData data : dataList) {
                final long authorId = data.getAuthorId();
                final Consumer<User> userConsumer = (user) -> {
                    builder.append('[').append(data.getCratedAt().format(DateTimeFormatter.RFC_1123_DATE_TIME)).append("] (").append(user.getAsTag()).append(" - ").append(user.getIdLong()).append(") [").append(data.getMessageId()).append("]: ").append(data.getContent()).append('\n');
                };
                if (tmpUsers.containsKey(authorId)) {
                    userConsumer.accept(tmpUsers.get(authorId));
                } else {
                    // try to fetch the user since we don't cache them
                    // calls are sequential making sure the messages are still in order
                    jda.retrieveUserById(authorId).queue((user) -> {
                        tmpUsers.put(authorId, user);
                        userConsumer.accept(user);
                    }, (error) -> userConsumer.accept(new UnknownUser(authorId)));
                }
            }
            final TextChannel channel = event.getChannel();
            final EmbedBuilder embed = EmbedUtils.embedField("Bulk Delete", "Bulk deleted messages from <#%s> are available in the attached file.".formatted(channel.getIdLong())).setColor(0xE67E22).setTimestamp(Instant.now());
            modLog(new MessageConfig.Builder().addEmbed(true, embed).setActionConfig((action) -> action.addFile(builder.toString().getBytes(), "bulk_delete_%s.txt".formatted(System.currentTimeMillis()))), guild);
        } catch (Exception e) {
            LOGGER.error("Exception on message bulk delete", e);
        }
    });
}
Also used : MessageData(ml.duncte123.skybot.objects.discord.MessageData) MessageBulkDeleteEvent(net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent) EmbedUtils(me.duncte123.botcommons.messaging.EmbedUtils) StringUtils(me.duncte123.botcommons.StringUtils) Permission(net.dv8tion.jda.api.Permission) CommandCategory(ml.duncte123.skybot.objects.command.CommandCategory) PerspectiveApi(ml.duncte123.skybot.utils.PerspectiveApi) UNKNOWN_MESSAGE(net.dv8tion.jda.api.requests.ErrorResponse.UNKNOWN_MESSAGE) SpamFilter(ml.duncte123.skybot.utils.SpamFilter) Matcher(java.util.regex.Matcher) GuildSettingsUtils(ml.duncte123.skybot.utils.GuildSettingsUtils) GuildMessageReceivedEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent) GuildSetting(com.dunctebot.models.settings.GuildSetting) GuildMessageUpdateEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageUpdateEvent) Variables(ml.duncte123.skybot.Variables) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) Executors(java.util.concurrent.Executors) UnknownUser(ml.duncte123.skybot.objects.user.UnknownUser) Pattern(java.util.regex.Pattern) MISSING_PERMISSIONS(net.dv8tion.jda.api.requests.ErrorResponse.MISSING_PERMISSIONS) ICommand(ml.duncte123.skybot.objects.command.ICommand) net.dv8tion.jda.api.entities(net.dv8tion.jda.api.entities) BotCommons(me.duncte123.botcommons.BotCommons) java.util(java.util) JDA(net.dv8tion.jda.api.JDA) MarkdownSanitizer(net.dv8tion.jda.api.utils.MarkdownSanitizer) CustomCommand(ml.duncte123.skybot.objects.command.custom.CustomCommand) GuildMessageDeleteEvent(net.dv8tion.jda.api.events.message.guild.GuildMessageDeleteEvent) MessageUtils(me.duncte123.botcommons.messaging.MessageUtils) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Sentry(io.sentry.Sentry) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) ErrorHandler(net.dv8tion.jda.api.exceptions.ErrorHandler) GenericGuildMessageEvent(net.dv8tion.jda.api.events.message.guild.GenericGuildMessageEvent) CommandUtils.isGuildPatron(ml.duncte123.skybot.utils.CommandUtils.isGuildPatron) ShardManager(net.dv8tion.jda.api.sharding.ShardManager) MessageUtils.sendMsg(me.duncte123.botcommons.messaging.MessageUtils.sendMsg) CommandContext(ml.duncte123.skybot.objects.command.CommandContext) CommandUtils.isDev(ml.duncte123.skybot.utils.CommandUtils.isDev) ModerationUtils.modLog(ml.duncte123.skybot.utils.ModerationUtils.modLog) CommandManager(ml.duncte123.skybot.CommandManager) DunctebotGuild(ml.duncte123.skybot.entities.jda.DunctebotGuild) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) AirUtils.setJDAContext(ml.duncte123.skybot.utils.AirUtils.setJDAContext) Triple(kotlin.Triple) Settings(ml.duncte123.skybot.Settings) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) MessageConfig(me.duncte123.botcommons.messaging.MessageConfig) RedisConnection(ml.duncte123.skybot.database.RedisConnection) DateTimeFormatter(java.time.format.DateTimeFormatter) UnknownUser(ml.duncte123.skybot.objects.user.UnknownUser) UnknownUser(ml.duncte123.skybot.objects.user.UnknownUser) MessageData(ml.duncte123.skybot.objects.discord.MessageData) JDA(net.dv8tion.jda.api.JDA) DunctebotGuild(ml.duncte123.skybot.entities.jda.DunctebotGuild) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) MessageConfig(me.duncte123.botcommons.messaging.MessageConfig)

Aggregations

MessageBulkDeleteEvent (net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent)5 GuildMessageDeleteEvent (net.dv8tion.jda.api.events.message.guild.GuildMessageDeleteEvent)4 GuildMessageUpdateEvent (net.dv8tion.jda.api.events.message.guild.GuildMessageUpdateEvent)4 Instant (java.time.Instant)3 java.util (java.util)3 Collectors (java.util.stream.Collectors)3 GuildSetting (com.dunctebot.models.settings.GuildSetting)2 Sentry (io.sentry.Sentry)2 DateTimeFormatter (java.time.format.DateTimeFormatter)2 JDA (net.dv8tion.jda.api.JDA)2 Permission (net.dv8tion.jda.api.Permission)2 net.dv8tion.jda.api.entities (net.dv8tion.jda.api.entities)2 WebhookEmbed (club.minnced.discord.webhook.send.WebhookEmbed)1 EmbedAuthor (club.minnced.discord.webhook.send.WebhookEmbed.EmbedAuthor)1 EmbedField (club.minnced.discord.webhook.send.WebhookEmbed.EmbedField)1 EmbedFooter (club.minnced.discord.webhook.send.WebhookEmbed.EmbedFooter)1 WebhookEmbedBuilder (club.minnced.discord.webhook.send.WebhookEmbedBuilder)1 Accumulators (com.mongodb.client.model.Accumulators)1 Aggregates (com.mongodb.client.model.Aggregates)1 Filters (com.mongodb.client.model.Filters)1