summaryrefslogtreecommitdiff
path: root/src/main/kotlin/io/dico/parcels2/command/ParcelsChatHandler.kt
diff options
context:
space:
mode:
authorDico <dico.karssiens@gmail.com>2018-09-28 05:47:32 +0100
committerDico <dico.karssiens@gmail.com>2018-09-28 05:47:32 +0100
commitbb6ae7d37037180f4cb29a084b1e2ab1a86c747a (patch)
treeacabff0f5710c60a54ece8a7d0a38f34ee074e6d /src/main/kotlin/io/dico/parcels2/command/ParcelsChatHandler.kt
parent09aaa9ff725787be4f56986d58e61ee41e3140cb (diff)
Add /p global list, tweaks/fixes
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/command/ParcelsChatHandler.kt')
-rw-r--r--src/main/kotlin/io/dico/parcels2/command/ParcelsChatHandler.kt24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/kotlin/io/dico/parcels2/command/ParcelsChatHandler.kt b/src/main/kotlin/io/dico/parcels2/command/ParcelsChatHandler.kt
new file mode 100644
index 0000000..b616f77
--- /dev/null
+++ b/src/main/kotlin/io/dico/parcels2/command/ParcelsChatHandler.kt
@@ -0,0 +1,24 @@
+package io.dico.parcels2.command
+
+import io.dico.dicore.Formatting
+import io.dico.dicore.command.EMessageType
+import io.dico.dicore.command.ExecutionContext
+import io.dico.dicore.command.chat.AbstractChatHandler
+import io.dico.parcels2.util.ext.plus
+
+class ParcelsChatHandler : AbstractChatHandler() {
+
+ override fun getMessagePrefixForType(type: EMessageType?): String {
+ return Formatting.RED + "[Parcels] "
+ }
+
+ override fun createMessage(context: ExecutionContext, type: EMessageType, message: String?): String? {
+ if (message.isNullOrEmpty()) return null
+ var result = getChatFormatForType(type) + message
+ if (context.address.mainKey != "info") {
+ result = getMessagePrefixForType(type) + result
+ }
+ return result
+ }
+
+} \ No newline at end of file