Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class GuildConfig {
private StarboardConfig starboardConfig;
private MessageCacheConfig messageCacheConfig;
private ServerLockConfig serverLockConfig;
private List<String> blacklistedMessageExtensions;
private List<String> blacklistedMessageExtensions = List.of("jar", "exe", "zip");

/**
* Constructor that initializes all Config classes.
Expand All @@ -56,7 +56,6 @@ public GuildConfig(Guild guild, Path file) {
this.starboardConfig = new StarboardConfig();
this.messageCacheConfig = new MessageCacheConfig();
this.serverLockConfig = new ServerLockConfig();
this.blacklistedMessageExtensions = List.of("jar", "exe", "zip");
this.setGuild(guild);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.List;

/**
* This {@link MessageFilter} blocks attachments blacklisted using {@link GuildConfig#getBlacklistedMessageExtensions()}.
* This {@link MessageFilter} blocks attachments blacklisted using {@link GuildConfig}.
*/
@Component
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import java.util.List;

/**
* A class storing different parameters of a message sent.
* @param event The event associated with the message
* A class containing modifiable content of a message that has been received.
* @param event The event associated with receiving the message
* @param messageText The text associated with the message
* @param attachments The attachments associated with the message
* @param embeds The embeds associated with the message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
/**
* This interface is implemented by all message filters.
*
* The {@link MessageContent} is processed through every class implementing {@link MessageFilter}
* unless one of the filters returns {@link MessageModificationStatus#STOP_PROCESSING} which stops further filters from processing.
* The {@link MessageContent} is processed by every class implementing {@link MessageFilter}
* unless one of the filters returns {@link MessageModificationStatus#STOP_PROCESSING} which stops further filters from executing.
*/
public interface MessageFilter {

/**
* When a message is received, it is executed on the registered filters.
* When a message is received, it is processed on the registered filters.
*
* @param content The content of the new message that will be reposted instead of the received message
* if at least one filter returns {@link MessageModificationStatus#MODIFIED}
* and no filter returns {@link MessageModificationStatus#STOP_PROCESSING}.
* This {@link MessageContent} is built up incrementally by the filters.
* @return the appropriate {@link MessageModificationStatus} based on the filter's processing.
* @see MessageFilterHandler for the implementation of the filters.
* @see MessageFilterHandler
*/
MessageModificationStatus processMessage(MessageContent content);

Expand Down