Package net.deechael.dynamichat.api
Interface ChatManager
- All Known Implementing Classes:
BukkitChatManager
public interface ChatManager
To manage all the things of DynamicChat
-
Method Summary
Modifier and TypeMethodDescriptioncreateTemporaryChannel(@Nullable String displayName, @Nullable String format) Create a temporary channelcreateTime(int years, int months, int weeks, int days, int hours, int minutes, int seconds) Create a time obejctcreateTime(long seconds) To create time from seconds longGet ban ip manager to ban or unban ipintBecause the index of buttons can be customized, this will return the max index of the registered buttonsMap<Integer,? extends MessageButton> Get all the registered buttonsgetChannel(String name) Get the channel by nameGet all channelsgetContext(int startIndex, int endIndex) Get contextgetContext(MuteMessage startMessage, int amount) Get the context start from a message objectGet default language nameGet the global channelintgetIndex(MuteMessage message) Get the index of the messagegetMessageById(String id) Get the message by idgetMessageByIndex(int index) Get a message by indexList<? extends TemporaryChannel>Get all temporary channelsbooleanTo check whether language should follow the clientParse time from stringintTo get how many messages that have been storedvoidregisterButton(int index, MessageButton button) Register the button showing when click the message
-
Method Details
-
getChannel
Get the channel by name- Parameters:
name- channel name- Returns:
- channel
-
getChannels
Get all channels- Returns:
- all channels
-
getTemporaryChannels
List<? extends TemporaryChannel> getTemporaryChannels()Get all temporary channels- Returns:
- all temporary channels
-
getGlobal
Channel getGlobal()Get the global channel- Returns:
- global channel
-
createTemporaryChannel
TemporaryChannel createTemporaryChannel(@Nullable @Nullable String displayName, @Nullable @Nullable String format) Create a temporary channel- Parameters:
displayName- the display nameformat- chat format- Returns:
- the temporary channel
-
registerButton
Register the button showing when click the message- Parameters:
index- the index, don't be in [0, 10], this is the range of the buttons of official extensionsbutton- button object
-
getButtons
Map<Integer,? extends MessageButton> getButtons()Get all the registered buttons- Returns:
- (index, button object)
-
getButtonMaxIndex
int getButtonMaxIndex()Because the index of buttons can be customized, this will return the max index of the registered buttons- Returns:
- the max index
-
languageFollowClient
boolean languageFollowClient()To check whether language should follow the client- Returns:
- status
-
getDefaultLanguage
String getDefaultLanguage()Get default language name- Returns:
- default language
-
getIndex
Get the index of the message- Parameters:
message- message- Returns:
- the index
-
getMessageByIndex
Get a message by index- Parameters:
index- the index of the message- Returns:
- the message
-
getMessageById
Get the message by id- Parameters:
id- the id of the message- Returns:
- the message
-
getContext
Get context- Parameters:
startIndex- start indexendIndex- end index- Returns:
- the context
-
getContext
Get the context start from a message object- Parameters:
startMessage- start messageamount- the amount- Returns:
- the context
-
recordedMessages
int recordedMessages()To get how many messages that have been stored- Returns:
- the amount of the stored messages
-
createTime
Create a time obejct- Parameters:
years- yesrsmonths- monthsweeks- weeksdays- dayshours- hoursminutes- minutesseconds- seconds- Returns:
- a time object
-
createTime
To create time from seconds long- Parameters:
seconds- seconds not milliseconds- Returns:
- a time objects
-
parseTime
Parse time from string- Parameters:
timeString- e.g. 1y2mo3wk4d5h6min7s- Returns:
- a time object
-
getBanIPManager
BanIPManager getBanIPManager()Get ban ip manager to ban or unban ip- Returns:
- BanIPManager
-