Cleaned up and added test to messages.

This commit is contained in:
Erik C. Thauvin 2021-07-30 12:23:52 -07:00
parent 00caee4bc1
commit d05499a76f
3 changed files with 66 additions and 3 deletions

View file

@ -39,6 +39,5 @@ class ErrorMessage @JvmOverloads constructor(msg: String, color: String = DEFAUL
this.msg = msg
this.color = color
isError = true
isNotice = true
}
}

View file

@ -32,7 +32,6 @@
package net.thauvin.erik.mobibot.msg
import net.thauvin.erik.semver.Constants
import org.jibble.pircbot.Colors
/**
* The `Message` class.
@ -47,6 +46,10 @@ open class Message {
/** Error flag. */
var isError = false
set(value) {
if (value) isNotice = value
field = value
}
/** Notice flag. */
var isNotice = false
@ -66,7 +69,13 @@ open class Message {
* Creates a new message.
*/
@JvmOverloads
constructor(msg: String, color: String = DEFAULT_COLOR, isNotice: Boolean, isError: Boolean, isPrivate: Boolean) {
constructor(
msg: String,
color: String = DEFAULT_COLOR,
isNotice: Boolean = false,
isError: Boolean = false,
isPrivate: Boolean = false
) {
this.msg = msg
this.color = color
this.isNotice = isNotice