diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/ChannelFeed.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/ChannelFeed.kt index 637aec5..9c50932 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/ChannelFeed.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/ChannelFeed.kt @@ -34,14 +34,11 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.FeedReader import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat class ChannelFeed(bot: Mobibot, channel: String) : AbstractCommand(bot) { override val name = channel - override val help = listOf( - "To list the last 5 posts from the channel's weblog feed:", - Utils.helpFormat("%c $channel") - ) + override val help = listOf("To list the last 5 posts from the channel's weblog feed:", helpFormat("%c $channel")) override val isOp = false override val isPublic = true override val isVisible = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Cycle.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Cycle.kt index 32c06e5..88de89b 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Cycle.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Cycle.kt @@ -33,13 +33,13 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat class Cycle(bot: Mobibot) : AbstractCommand(bot) { @Suppress("MagicNumber") private val wait = 10 override val name = "cycle" - override val help = listOf("To have the bot leave the channel and come back:", Utils.helpFormat("%c $name")) + override val help = listOf("To have the bot leave the channel and come back:", helpFormat("%c $name")) override val isOp = true override val isPublic = false override val isVisible = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Me.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Me.kt index c668fe0..4b996f1 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Me.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Me.kt @@ -33,14 +33,11 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat class Me(bot: Mobibot) : AbstractCommand(bot) { override val name = "me" - override val help = listOf( - "To have the bot perform an action:", - Utils.helpFormat("%c $name ") - ) + override val help = listOf("To have the bot perform an action:", helpFormat("%c $name ")) override val isOp = true override val isPublic = false override val isVisible = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Modules.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Modules.kt index 50ddc93..2bd43c9 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Modules.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Modules.kt @@ -33,14 +33,11 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat class Modules(bot: Mobibot) : AbstractCommand(bot) { override val name = "modules" - override val help = listOf( - "To view a list of enabled modules:", - Utils.helpFormat("%c $name") - ) + override val help = listOf("To view a list of enabled modules:", helpFormat("%c $name")) override val isOp = true override val isPublic = false override val isVisible = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Msg.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Msg.kt index 4e7aa4d..5e9b5ae 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Msg.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Msg.kt @@ -33,13 +33,13 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat class Msg(bot: Mobibot) : AbstractCommand(bot) { override val name = "msg" override val help = listOf( "To have the bot send a private message to someone:", - Utils.helpFormat("%c $name ") + helpFormat("%c $name ") ) override val isOp = true override val isPublic = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Nick.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Nick.kt index fa1ff2c..b4495b3 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Nick.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Nick.kt @@ -33,14 +33,11 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat class Nick(bot: Mobibot) : AbstractCommand(bot) { override val name = "nick" - override val help = listOf( - "To change the bot's nickname:", - Utils.helpFormat("%c $name ") - ) + override val help = listOf("To change the bot's nickname:", helpFormat("%c $name ")) override val isOp = true override val isPublic = true override val isVisible = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Say.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Say.kt index af08502..198ea8c 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Say.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Say.kt @@ -33,14 +33,11 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat class Say(bot: Mobibot) : AbstractCommand(bot) { override val name = "say" - override val help = listOf( - "To have the bot say something on the channel:", - Utils.helpFormat("%c $name ") - ) + override val help = listOf("To have the bot say something on the channel:", helpFormat("%c $name ")) override val isOp = true override val isPublic = false override val isVisible = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Users.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Users.kt index 1d1ec6e..4db1781 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Users.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Users.kt @@ -33,14 +33,11 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat class Users(bot: Mobibot) : AbstractCommand(bot) { override val name = "users" - override val help = listOf( - "To list the users present on the channel:", - Utils.helpFormat("%c $name") - ) + override val help = listOf("To list the users present on the channel:", helpFormat("%c $name")) override val isOp = false override val isPublic = true override val isVisible = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Comment.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Comment.kt index 9a8685a..ebe7067 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Comment.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Comment.kt @@ -34,7 +34,8 @@ package net.thauvin.erik.mobibot.commands.links import net.thauvin.erik.mobibot.Constants import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.bold +import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.commands.AbstractCommand import net.thauvin.erik.mobibot.entries.EntriesUtils import net.thauvin.erik.mobibot.entries.EntryLink @@ -43,12 +44,12 @@ class Comment(bot: Mobibot) : AbstractCommand(bot) { override val name = COMMAND override val help = listOf( "To add a comment:", - Utils.helpFormat("${Constants.LINK_CMD}1:This is a comment"), - "I will reply with a label, for example: ${Utils.bold(Constants.LINK_CMD)}1.1", + helpFormat("${Constants.LINK_CMD}1:This is a comment"), + "I will reply with a label, for example: ${bold(Constants.LINK_CMD)}1.1", "To edit a comment, use its label: ", - Utils.helpFormat("${Constants.LINK_CMD}1.1:This is an edited comment"), + helpFormat("${Constants.LINK_CMD}1.1:This is an edited comment"), "To delete a comment, use its label and a minus sign: ", - Utils.helpFormat("${Constants.LINK_CMD}1.1:-") + helpFormat("${Constants.LINK_CMD}1.1:-") ) override val isOp = false override val isPublic = true @@ -99,7 +100,7 @@ class Comment(bot: Mobibot) : AbstractCommand(bot) { bot.send(sender, "To change a comment's author:", isPrivate) bot.send( sender, - Utils.helpFormat("${Constants.LINK_CMD}1.1:?"), + helpFormat("${Constants.LINK_CMD}1.1:?"), isPrivate ) } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Posting.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Posting.kt index ef993cb..77c9b43 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Posting.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Posting.kt @@ -34,7 +34,8 @@ package net.thauvin.erik.mobibot.commands.links import net.thauvin.erik.mobibot.Constants import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.bold +import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.commands.AbstractCommand import net.thauvin.erik.mobibot.commands.links.LinksMgr.Companion.entries import net.thauvin.erik.mobibot.entries.EntriesUtils @@ -44,15 +45,15 @@ class Posting(bot: Mobibot) : AbstractCommand(bot) { override val name = "posting" override val help = listOf( "Post a URL, by saying it on a line on its own:", - Utils.helpFormat(" [] ${Tags.COMMAND}: <+tag> [...]]"), - "I will reply with a label, for example: ${Utils.bold(Constants.LINK_CMD)}1", + helpFormat("<url> [<title>] ${Tags.COMMAND}: <+tag> [...]]"), + "I will reply with a label, for example: ${bold(Constants.LINK_CMD)}1", "To add a title, use its label and a pipe:", - Utils.helpFormat("${Constants.LINK_CMD}1:|This is the title"), + helpFormat("${Constants.LINK_CMD}1:|This is the title"), "To add a comment:", - Utils.helpFormat("${Constants.LINK_CMD}1:This is a comment"), - "I will reply with a label, for example: ${Utils.bold(Constants.LINK_CMD)}1.1", + helpFormat("${Constants.LINK_CMD}1:This is a comment"), + "I will reply with a label, for example: ${bold(Constants.LINK_CMD)}1.1", "To edit a comment, see: ", - Utils.helpFormat("%c ${Constants.HELP_CMD} ${Comment.COMMAND}") + helpFormat("%c ${Constants.HELP_CMD} ${Comment.COMMAND}") ) override val isOp = false override val isPublic = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Tags.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Tags.kt index 1481166..554d6c8 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Tags.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/Tags.kt @@ -34,7 +34,7 @@ package net.thauvin.erik.mobibot.commands.links import net.thauvin.erik.mobibot.Constants import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.commands.AbstractCommand import net.thauvin.erik.mobibot.entries.EntriesUtils import net.thauvin.erik.mobibot.entries.EntryLink @@ -43,7 +43,7 @@ class Tags(bot: Mobibot) : AbstractCommand(bot) { override val name = COMMAND override val help = listOf( "To categorize or tag a URL, use its label and a T:", - Utils.helpFormat("${Constants.LINK_CMD}1T:<+tag|-tag> [...]") + helpFormat("${Constants.LINK_CMD}1T:<+tag|-tag> [...]") ) override val isOp = false override val isPublic = true diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/View.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/View.kt index 0627d93..45da0f5 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/View.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/links/View.kt @@ -33,7 +33,8 @@ package net.thauvin.erik.mobibot.commands.links import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.bold +import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.commands.AbstractCommand import net.thauvin.erik.mobibot.commands.links.LinksMgr.Companion.entries import net.thauvin.erik.mobibot.entries.EntriesUtils @@ -45,7 +46,7 @@ class View(bot: Mobibot) : AbstractCommand(bot) { override val name = VIEW_CMD override val help = listOf( "To list or search the current URL posts:", - Utils.helpFormat("%c $name [<start>] [<query>]") + helpFormat("%c $name [<start>] [<query>]") ) override val isOp = false override val isPublic = true @@ -109,7 +110,7 @@ class View(bot: Mobibot) : AbstractCommand(bot) { i++ if (sent == maxEntries && i < max) { bot.send( - sender, "To view more, try: " + Utils.bold("${bot.nick}: $name ${i + 1} $lcArgs"), false + sender, "To view more, try: " + bold("${bot.nick}: $name ${i + 1} $lcArgs"), false ) } } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/AbstractModule.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/AbstractModule.kt index 3448fa8..3c46fb4 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/AbstractModule.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/AbstractModule.kt @@ -32,7 +32,7 @@ package net.thauvin.erik.mobibot.modules import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.buildCmdSyntax /** * The `Module` abstract class. @@ -76,7 +76,7 @@ abstract class AbstractModule(val bot: Mobibot) { */ open fun helpResponse(sender: String, isPrivate: Boolean): Boolean { for (h in help) { - bot.send(sender, Utils.buildCmdSyntax(h, bot.nick, isPrivateMsgEnabled && isPrivate), isPrivate) + bot.send(sender, buildCmdSyntax(h, bot.nick, isPrivateMsgEnabled && isPrivate), isPrivate) } return true } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Calc.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Calc.kt index 9704461..a197391 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Calc.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Calc.kt @@ -34,7 +34,8 @@ package net.thauvin.erik.mobibot.modules import net.objecthunter.exp4j.ExpressionBuilder import net.objecthunter.exp4j.tokenizer.UnknownFunctionOrVariableException import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.bold +import net.thauvin.erik.mobibot.Utils.helpFormat import java.text.DecimalFormat /** @@ -74,13 +75,13 @@ class Calc(bot: Mobibot) : AbstractModule(bot) { fun calculate(query: String): String { val decimalFormat = DecimalFormat("#.##") val calc = ExpressionBuilder(query).build() - return query.replace(" ", "") + " = " + Utils.bold(decimalFormat.format(calc.evaluate())) + return query.replace(" ", "") + " = " + bold(decimalFormat.format(calc.evaluate())) } } init { commands.add(CALC_CMD) help.add("To solve a mathematical calculation:") - help.add(Utils.helpFormat("%c $CALC_CMD <calculation>")) + help.add(helpFormat("%c $CALC_CMD <calculation>")) } } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/CryptoPrices.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/CryptoPrices.kt index a1313a0..4cd57c2 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/CryptoPrices.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/CryptoPrices.kt @@ -35,7 +35,7 @@ import net.thauvin.erik.crypto.CryptoException import net.thauvin.erik.crypto.CryptoPrice import net.thauvin.erik.crypto.CryptoPrice.Companion.marketPrice import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.msg.PublicMessage /** @@ -83,10 +83,10 @@ class CryptoPrices(bot: Mobibot) : ThreadedModule(bot) { init { commands.add(CRYPTO_CMD) help.add("To retrieve a cryptocurrency's market price:") - help.add(Utils.helpFormat("%c $CRYPTO_CMD <symbol> [<currency>]")) + help.add(helpFormat("%c $CRYPTO_CMD <symbol> [<currency>]")) help.add("For example:") - help.add(Utils.helpFormat("%c $CRYPTO_CMD BTC")) - help.add(Utils.helpFormat("%c $CRYPTO_CMD ETH EUR")) - help.add(Utils.helpFormat("%c $CRYPTO_CMD ETH2 GPB")) + help.add(helpFormat("%c $CRYPTO_CMD BTC")) + help.add(helpFormat("%c $CRYPTO_CMD ETH EUR")) + help.add(helpFormat("%c $CRYPTO_CMD ETH2 GPB")) } } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Dice.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Dice.kt index 53c39ad..8d1afc3 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Dice.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Dice.kt @@ -32,7 +32,8 @@ package net.thauvin.erik.mobibot.modules import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.bold +import net.thauvin.erik.mobibot.Utils.helpFormat import kotlin.random.Random /** @@ -52,13 +53,13 @@ class Dice(bot: Mobibot) : AbstractModule(bot) { with(bot) { send( channel, - "$sender rolled two dice: ${Utils.bold(playerRoll.first)} and ${Utils.bold(playerRoll.second)}" - + " for a total of ${Utils.bold(playerTotal)}", + "$sender rolled two dice: ${bold(playerRoll.first)} and ${bold(playerRoll.second)}" + + " for a total of ${bold(playerTotal)}", isPrivate ) action( - "rolled two dice: ${Utils.bold(roll.first)} and ${Utils.bold(roll.second)}" + - " for a total of ${Utils.bold(total)}" + "rolled two dice: ${bold(roll.first)} and ${bold(roll.second)}" + + " for a total of ${bold(total)}" ) when (winLoseOrTie(total, playerTotal)) { Result.WIN -> action("wins.") @@ -99,6 +100,6 @@ class Dice(bot: Mobibot) : AbstractModule(bot) { init { commands.add(DICE_CMD) help.add("To roll the dice:") - help.add(Utils.helpFormat("%c $DICE_CMD")) + help.add(helpFormat("%c $DICE_CMD")) } } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Lookup.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Lookup.kt index 6ead8e7..8c50d09 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Lookup.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Lookup.kt @@ -33,7 +33,7 @@ package net.thauvin.erik.mobibot.modules import net.thauvin.erik.mobibot.Constants import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat import org.apache.commons.net.whois.WhoisClient import java.io.IOException import java.net.InetAddress @@ -164,6 +164,6 @@ class Lookup(bot: Mobibot) : AbstractModule(bot) { init { commands.add(LOOKUP_CMD) help.add("To perform a DNS lookup query:") - help.add(Utils.helpFormat("%c $LOOKUP_CMD <ip address or hostname>")) + help.add(helpFormat("%c $LOOKUP_CMD <ip address or hostname>")) } } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/ModuleException.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/ModuleException.kt index 3e77d96..c970aca 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/ModuleException.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/ModuleException.kt @@ -31,7 +31,7 @@ */ package net.thauvin.erik.mobibot.modules -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.obfuscate import org.apache.commons.lang3.StringUtils /** @@ -68,7 +68,7 @@ class ModuleException : Exception { * Return the sanitized message (e.g. remove API keys, etc.) */ fun getSanitizedMessage(vararg sanitize: String): String { - val obfuscate = sanitize.map { Utils.obfuscate(it) }.toTypedArray() + val obfuscate = sanitize.map { obfuscate(it) }.toTypedArray() return when { cause != null -> { cause.javaClass.name + ": " + StringUtils.replaceEach(cause.message, sanitize, obfuscate) diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Ping.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Ping.kt index ecfdf47..0a97d7b 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Ping.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Ping.kt @@ -32,7 +32,7 @@ package net.thauvin.erik.mobibot.modules import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat import kotlin.random.Random /** @@ -85,6 +85,6 @@ class Ping(bot: Mobibot) : AbstractModule(bot) { init { commands.add(PING_CMD) help.add("To ping the bot:") - help.add(Utils.helpFormat("%c $PING_CMD")) + help.add(helpFormat("%c $PING_CMD")) } } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Twitter.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Twitter.kt index 7fdefd4..eb08dd5 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/Twitter.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/Twitter.kt @@ -34,7 +34,7 @@ package net.thauvin.erik.mobibot.modules import net.thauvin.erik.mobibot.Constants import net.thauvin.erik.mobibot.Mobibot import net.thauvin.erik.mobibot.TwitterTimer -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.commands.links.LinksMgr import net.thauvin.erik.mobibot.entries.EntriesUtils import net.thauvin.erik.mobibot.msg.Message @@ -235,7 +235,7 @@ class Twitter(bot: Mobibot) : ThreadedModule(bot) { init { commands.add(TWITTER_CMD) help.add("To post to Twitter:") - help.add(Utils.helpFormat("%c $TWITTER_CMD <message>")) + help.add(helpFormat("%c $TWITTER_CMD <message>")) properties[AUTOPOST_PROP] = "false" initProperties(CONSUMER_KEY_PROP, CONSUMER_SECRET_PROP, HANDLE_PROP, TOKEN_PROP, TOKEN_SECRET_PROP) } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/WorldTime.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/WorldTime.kt index 0b21462..0d74165 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/WorldTime.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/WorldTime.kt @@ -32,7 +32,8 @@ package net.thauvin.erik.mobibot.modules import net.thauvin.erik.mobibot.Mobibot -import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.Utils.bold +import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.msg.ErrorMessage import net.thauvin.erik.mobibot.msg.Message import net.thauvin.erik.mobibot.msg.PublicMessage @@ -76,16 +77,16 @@ class WorldTime(bot: Mobibot) : AbstractModule(bot) { val tz = COUNTRIES_MAP[(query.substring(query.indexOf(' ') + 1).trim()).uppercase()] val response: String = if (tz != null) { if (BEATS_KEYWORD == tz) { - "The current Internet Time is: " + Utils.bold(internetTime() + ' ' + BEATS_KEYWORD) + "The current Internet Time is: " + bold(internetTime() + ' ' + BEATS_KEYWORD) } else { (ZonedDateTime.now() .withZoneSameInstant(ZoneId.of(tz)) .format( DateTimeFormatter.ofPattern( - "'The time is ${Utils.bold("'HH:mm'")} on ${Utils.bold("'EEEE, d MMMM yyyy'")} in '" + "'The time is ${bold("'HH:mm'")} on ${bold("'EEEE, d MMMM yyyy'")} in '" ) ) - + Utils.bold(tz.substring(tz.indexOf('/') + 1).replace('_', ' ')) + + bold(tz.substring(tz.indexOf('/') + 1).replace('_', ' ')) ) } } else { @@ -214,9 +215,9 @@ class WorldTime(bot: Mobibot) : AbstractModule(bot) { init { help.add("To display a country's current date/time:") - help.add(Utils.helpFormat("%c $TIME_CMD") + " [<country code>]") + help.add(helpFormat("%c $TIME_CMD") + " [<country code>]") help.add("For a listing of the supported countries:") - help.add(Utils.helpFormat("%c $TIME_CMD")) + help.add(helpFormat("%c $TIME_CMD")) commands.add(TIME_CMD) } } diff --git a/version.properties b/version.properties index be3f7f2..596efc1 100644 --- a/version.properties +++ b/version.properties @@ -1,9 +1,9 @@ #Generated by the Semver Plugin for Gradle -#Tue May 11 01:30:42 PDT 2021 -version.buildmeta=726 +#Tue May 11 12:39:39 PDT 2021 +version.buildmeta=727 version.major=0 version.minor=8 version.patch=0 version.prerelease=beta version.project=mobibot -version.semver=0.8.0-beta+726 +version.semver=0.8.0-beta+727