Interface Announcement
public interface Announcement
Represents a broadcast announcement that is sent to one or more
channels.
Create instances via the static factory methods
of(Component, Iterable)
or of(Component, ChatChannel...).
-
Method Summary
Modifier and TypeMethodDescriptionchannels()Returns the channels this announcement will be broadcast to.static AnnouncementfromConfigField(AnnouncementsSettings.Announcement announcementField) Creates an announcement from its configuration-file representation.message()Returns the message component that will be sent.static AnnouncementCreates a new announcement targeting the given channels.static Announcementof(@NotNull Component message, @NotNull ChatChannel... channels) Creates a new announcement targeting the given channels.
-
Method Details
-
of
static Announcement of(@NotNull @NotNull Component message, @NotNull @NotNull Iterable<ChatChannel> channels) Creates a new announcement targeting the given channels.- Parameters:
message- the message to broadcastchannels- the channels to send the message to- Returns:
- a new announcement instance
-
of
static Announcement of(@NotNull @NotNull Component message, @NotNull @NotNull ChatChannel... channels) Creates a new announcement targeting the given channels.- Parameters:
message- the message to broadcastchannels- the channels to send the message to- Returns:
- a new announcement instance
-
fromConfigField
Creates an announcement from its configuration-file representation.- Parameters:
announcementField- the config section representing this announcement- Returns:
- a new announcement instance
-
channels
Returns the channels this announcement will be broadcast to.- Returns:
- the target channels
-
message
Returns the message component that will be sent.- Returns:
- the announcement message
-