From b9deb55de6e09ebcff61386cecaa18df0b380062 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 19 Sep 2022 01:37:36 -0700 Subject: [PATCH] Misc. Cleanup --- build.gradle | 1 + .../net/thauvin/erik/mobibot/modules/GoogleSearch.kt | 7 ++++++- .../net/thauvin/erik/mobibot/modules/WolframAlphaTest.kt | 2 +- version.properties | 6 +++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 2e94943..f8029a3 100644 --- a/build.gradle +++ b/build.gradle @@ -211,6 +211,7 @@ task deploy { doLast { file(deployDir + '/logs').mkdir() } + mustRunAfter(clean) } task release { diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/GoogleSearch.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/GoogleSearch.kt index 53b1b97..7499ec8 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/GoogleSearch.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/GoogleSearch.kt @@ -33,6 +33,7 @@ package net.thauvin.erik.mobibot.modules import net.thauvin.erik.mobibot.ReleaseInfo import net.thauvin.erik.mobibot.Utils.capitalise +import net.thauvin.erik.mobibot.Utils.colorize import net.thauvin.erik.mobibot.Utils.encodeUrl import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.Utils.reader @@ -71,7 +72,11 @@ class GoogleSearch : ThreadedModule() { event.user.nick ) for (msg in results) { - event.sendMessage(channel, msg) + if (msg.isError) { + event.respond(msg.msg.colorize(msg.color)) + } else { + event.sendMessage(channel, msg) + } } } catch (e: ModuleException) { if (logger.isWarnEnabled) logger.warn(e.debugMessage, e) diff --git a/src/test/kotlin/net/thauvin/erik/mobibot/modules/WolframAlphaTest.kt b/src/test/kotlin/net/thauvin/erik/mobibot/modules/WolframAlphaTest.kt index 00b1f42..419486e 100644 --- a/src/test/kotlin/net/thauvin/erik/mobibot/modules/WolframAlphaTest.kt +++ b/src/test/kotlin/net/thauvin/erik/mobibot/modules/WolframAlphaTest.kt @@ -42,7 +42,7 @@ import net.thauvin.erik.mobibot.LocalProperties import org.testng.annotations.Test class WolframAlphaTest : LocalProperties() { - @Test(groups=["modules"]) + @Test(groups = ["modules"]) fun testAppId() { assertThat { WolframAlpha.queryWolfram("1 gallon to liter", appId = "DEMO") } .isFailure() diff --git a/version.properties b/version.properties index 9557b08..6abe999 100644 --- a/version.properties +++ b/version.properties @@ -1,9 +1,9 @@ #Generated by the Semver Plugin for Gradle -#Sat Sep 17 21:38:39 PDT 2022 -version.buildmeta=633 +#Mon Sep 19 01:34:05 PDT 2022 +version.buildmeta=667 version.major=0 version.minor=8 version.patch=0 version.prerelease=rc version.project=mobibot -version.semver=0.8.0-rc+633 +version.semver=0.8.0-rc+667