[fix] DiscordNotifs color and detection bug

Signed-off-by: Dominika <sokolov.dominika@gmail.com>
This commit is contained in:
Dominika 2021-01-16 20:09:26 -05:00
parent 4c70d675d0
commit 36c15751ff
No known key found for this signature in database
GPG Key ID: B4A5A6DCA70F861F
2 changed files with 4 additions and 2 deletions

View File

@ -31,6 +31,9 @@ internal object ChatTimestamp : Module(
val formattedTime: String
get() = "${separator.left}${color format TimeUtils.getTime(timeFormat, timeUnit)}${separator.right} "
val time: String
get() = "${separator.left}${TimeUtils.getTime(timeFormat, timeUnit)}${separator.right}"
@Suppress("unused")
private enum class Separator(override val displayName: String, val left: String, val right: String) : DisplayEnum {
ARROWS("< >", "<", ">"),

View File

@ -80,7 +80,6 @@ internal object DiscordNotifs : Module(
|| direct.value && MessageDetection.Direct.ANY detect message
|| restart.value && MessageDetection.Server.RESTART detect message
|| queue.value && MessageDetection.Server.QUEUE detect message
|| importantPings.value && MessageDetection.Server.QUEUE detect message
}
private fun getMessageType(message: String, server: String): String {
@ -109,7 +108,7 @@ internal object DiscordNotifs : Module(
private fun getTime() =
if (!time.value) ""
else ChatTimestamp.formattedTime
else ChatTimestamp.time
private fun sendMessage(content: String, avatarUrl: String) {
val tm = TemmieWebhook(url.value)