Misc. Cleanup
This commit is contained in:
parent
6e8726ea55
commit
b9deb55de6
4 changed files with 11 additions and 5 deletions
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue