Cleanup.
This commit is contained in:
parent
2e1c6e7732
commit
8098a4855d
10 changed files with 30 additions and 29 deletions
|
@ -44,7 +44,6 @@ import static net.thauvin.erik.mobibot.Utils.bold;
|
||||||
* The War module.
|
* The War module.
|
||||||
*
|
*
|
||||||
* @author <a href="https://erik.thauvin.net" target="_blank">Erik C. Thauvin</a>
|
* @author <a href="https://erik.thauvin.net" target="_blank">Erik C. Thauvin</a>
|
||||||
* @created 2014-04-28
|
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public final class War extends AbstractModule {
|
public final class War extends AbstractModule {
|
||||||
|
|
|
@ -38,9 +38,9 @@ import net.thauvin.erik.mobibot.Utils.buildCmdSyntax
|
||||||
import net.thauvin.erik.mobibot.Utils.colorize
|
import net.thauvin.erik.mobibot.Utils.colorize
|
||||||
import net.thauvin.erik.mobibot.Utils.getIntProperty
|
import net.thauvin.erik.mobibot.Utils.getIntProperty
|
||||||
import net.thauvin.erik.mobibot.Utils.helpFormat
|
import net.thauvin.erik.mobibot.Utils.helpFormat
|
||||||
import net.thauvin.erik.mobibot.Utils.today
|
|
||||||
import net.thauvin.erik.mobibot.Utils.toIsoLocalDate
|
|
||||||
import net.thauvin.erik.mobibot.Utils.toDir
|
import net.thauvin.erik.mobibot.Utils.toDir
|
||||||
|
import net.thauvin.erik.mobibot.Utils.toIsoLocalDate
|
||||||
|
import net.thauvin.erik.mobibot.Utils.today
|
||||||
import net.thauvin.erik.mobibot.commands.AddLog
|
import net.thauvin.erik.mobibot.commands.AddLog
|
||||||
import net.thauvin.erik.mobibot.commands.ChannelFeed
|
import net.thauvin.erik.mobibot.commands.ChannelFeed
|
||||||
import net.thauvin.erik.mobibot.commands.Cycle
|
import net.thauvin.erik.mobibot.commands.Cycle
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
package net.thauvin.erik.mobibot.commands
|
package net.thauvin.erik.mobibot.commands
|
||||||
|
|
||||||
import net.thauvin.erik.mobibot.Mobibot
|
import net.thauvin.erik.mobibot.Mobibot
|
||||||
import net.thauvin.erik.mobibot.Utils.toUtcDateTime
|
|
||||||
import net.thauvin.erik.mobibot.Utils.helpFormat
|
import net.thauvin.erik.mobibot.Utils.helpFormat
|
||||||
|
import net.thauvin.erik.mobibot.Utils.toUtcDateTime
|
||||||
import java.time.Clock
|
import java.time.Clock
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,8 @@ class Tell(bot: Mobibot) : AbstractCommand(bot) {
|
||||||
save()
|
save()
|
||||||
}
|
}
|
||||||
} else if (message.sender.equals(nickname, ignoreCase = true) && message.isReceived
|
} else if (message.sender.equals(nickname, ignoreCase = true) && message.isReceived
|
||||||
&& !message.isNotified) {
|
&& !message.isNotified
|
||||||
|
) {
|
||||||
bot.send(
|
bot.send(
|
||||||
nickname,
|
nickname,
|
||||||
"Your message ${reverseColor("[ID " + message.id + ']')} was sent to "
|
"Your message ${reverseColor("[ID " + message.id + ']')} was sent to "
|
||||||
|
|
|
@ -35,8 +35,8 @@ import net.thauvin.erik.mobibot.Mobibot
|
||||||
import net.thauvin.erik.mobibot.Utils.capitalise
|
import net.thauvin.erik.mobibot.Utils.capitalise
|
||||||
import net.thauvin.erik.mobibot.Utils.encodeUrl
|
import net.thauvin.erik.mobibot.Utils.encodeUrl
|
||||||
import net.thauvin.erik.mobibot.Utils.helpFormat
|
import net.thauvin.erik.mobibot.Utils.helpFormat
|
||||||
import net.thauvin.erik.mobibot.Utils.urlReader
|
|
||||||
import net.thauvin.erik.mobibot.Utils.unescapeXml
|
import net.thauvin.erik.mobibot.Utils.unescapeXml
|
||||||
|
import net.thauvin.erik.mobibot.Utils.urlReader
|
||||||
import net.thauvin.erik.mobibot.msg.Message
|
import net.thauvin.erik.mobibot.msg.Message
|
||||||
import net.thauvin.erik.mobibot.msg.NoticeMessage
|
import net.thauvin.erik.mobibot.msg.NoticeMessage
|
||||||
import org.jibble.pircbot.Colors
|
import org.jibble.pircbot.Colors
|
||||||
|
|
|
@ -179,7 +179,8 @@ class StockQuote(bot: Mobibot) : ThreadedModule(bot) {
|
||||||
add(NoticeMessage(" High: " + unescapeXml(quote.getString("03. high"))))
|
add(NoticeMessage(" High: " + unescapeXml(quote.getString("03. high"))))
|
||||||
add(NoticeMessage(" Low: " + unescapeXml(quote.getString("04. low"))))
|
add(NoticeMessage(" Low: " + unescapeXml(quote.getString("04. low"))))
|
||||||
add(NoticeMessage(" Volume: " + unescapeXml(quote.getString("06. volume"))))
|
add(NoticeMessage(" Volume: " + unescapeXml(quote.getString("06. volume"))))
|
||||||
add(NoticeMessage(
|
add(
|
||||||
|
NoticeMessage(
|
||||||
" Latest: " + unescapeXml(quote.getString("07. latest trading day"))
|
" Latest: " + unescapeXml(quote.getString("07. latest trading day"))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -36,8 +36,8 @@ import net.aksingh.owmjapis.core.OWM
|
||||||
import net.aksingh.owmjapis.core.OWM.Country
|
import net.aksingh.owmjapis.core.OWM.Country
|
||||||
import net.aksingh.owmjapis.model.CurrentWeather
|
import net.aksingh.owmjapis.model.CurrentWeather
|
||||||
import net.thauvin.erik.mobibot.Mobibot
|
import net.thauvin.erik.mobibot.Mobibot
|
||||||
import net.thauvin.erik.mobibot.Utils.capitalise
|
|
||||||
import net.thauvin.erik.mobibot.Utils.bold
|
import net.thauvin.erik.mobibot.Utils.bold
|
||||||
|
import net.thauvin.erik.mobibot.Utils.capitalise
|
||||||
import net.thauvin.erik.mobibot.Utils.encodeUrl
|
import net.thauvin.erik.mobibot.Utils.encodeUrl
|
||||||
import net.thauvin.erik.mobibot.Utils.helpFormat
|
import net.thauvin.erik.mobibot.Utils.helpFormat
|
||||||
import net.thauvin.erik.mobibot.msg.ErrorMessage
|
import net.thauvin.erik.mobibot.msg.ErrorMessage
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
package net.thauvin.erik.mobibot
|
package net.thauvin.erik.mobibot
|
||||||
|
|
||||||
import net.thauvin.erik.mobibot.Utils.bold
|
import net.thauvin.erik.mobibot.Utils.bold
|
||||||
import net.thauvin.erik.mobibot.Utils.capitalize
|
import net.thauvin.erik.mobibot.Utils.capitalise
|
||||||
import net.thauvin.erik.mobibot.Utils.colorize
|
import net.thauvin.erik.mobibot.Utils.colorize
|
||||||
import net.thauvin.erik.mobibot.Utils.cyan
|
import net.thauvin.erik.mobibot.Utils.cyan
|
||||||
import net.thauvin.erik.mobibot.Utils.getIntProperty
|
import net.thauvin.erik.mobibot.Utils.getIntProperty
|
||||||
|
@ -79,11 +79,10 @@ class UtilsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testCapitalize() {
|
fun testCapitalise() {
|
||||||
assertThat(capitalize("test")).describedAs("capitalize(test)").isEqualTo("Test")
|
assertThat("test".capitalise()).describedAs("capitalize(test)").isEqualTo("Test")
|
||||||
assertThat(capitalize("Test")).describedAs("capitalize(Test)").isEqualTo("Test")
|
assertThat("Test".capitalise()).describedAs("capitalize(Test)").isEqualTo("Test")
|
||||||
assertThat(capitalize(null)).describedAs("captitalize(null)").isNull()
|
assertThat("".capitalise()).describedAs("capitalize()").isEqualTo("")
|
||||||
assertThat(capitalize("")).describedAs("capitalize()").isEqualTo("")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -168,7 +167,8 @@ class UtilsTest {
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
fun testUrlReader() {
|
fun testUrlReader() {
|
||||||
assertThat(urlReader(URL("https://postman-echo.com/status/200"))).describedAs("urlReader()")
|
assertThat(urlReader(URL("https://postman-echo.com/status/200"))).describedAs("urlReader()")
|
||||||
.isEqualTo("{\"status\":200}"
|
.isEqualTo(
|
||||||
|
"{\"status\":200}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#Generated by the Semver Plugin for Gradle
|
#Generated by the Semver Plugin for Gradle
|
||||||
#Fri May 14 20:13:13 PDT 2021
|
#Fri May 14 21:44:23 PDT 2021
|
||||||
version.buildmeta=782
|
version.buildmeta=787
|
||||||
version.major=0
|
version.major=0
|
||||||
version.minor=8
|
version.minor=8
|
||||||
version.patch=0
|
version.patch=0
|
||||||
version.prerelease=beta
|
version.prerelease=beta
|
||||||
version.project=mobibot
|
version.project=mobibot
|
||||||
version.semver=0.8.0-beta+782
|
version.semver=0.8.0-beta+787
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue