Compare commits
2 commits
6967341514
...
066e3f81e9
Author | SHA1 | Date | |
---|---|---|---|
066e3f81e9 | |||
5c3eaf232d |
3 changed files with 7 additions and 5 deletions
|
@ -46,6 +46,7 @@ import org.pircbotx.hooks.types.GenericMessageEvent
|
|||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.io.IOException
|
||||
import java.math.RoundingMode
|
||||
import java.net.URL
|
||||
import java.time.Instant
|
||||
import java.time.ZoneId
|
||||
|
@ -180,7 +181,8 @@ class StockQuote2 : AbstractModule() {
|
|||
)
|
||||
add(
|
||||
NoticeMessage(
|
||||
"Change: ".padEnd(pad).prependIndent() + change + " [$changePercent%]"
|
||||
"Change: ".padEnd(pad).prependIndent() + change
|
||||
+ " [${changePercent.setScale(2, RoundingMode.DOWN)}%]"
|
||||
)
|
||||
)
|
||||
add(
|
||||
|
@ -264,7 +266,7 @@ class StockQuote2 : AbstractModule() {
|
|||
val name = result.getString("description")
|
||||
|
||||
add(
|
||||
NoticeMessage("${symbol.bold()}: $name".prependIndent())
|
||||
NoticeMessage("${symbol.bold().padEnd(10)} $name".prependIndent())
|
||||
)
|
||||
|
||||
if (i >= 4) {
|
||||
|
|
|
@ -161,7 +161,7 @@ class StockQuote2Test : LocalProperties() {
|
|||
|
||||
var hasGoog = false
|
||||
for (msg in messages) {
|
||||
if (msg.msg.matches("\\s+\u0002GOOG\u0002: .*".toRegex())) {
|
||||
if (msg.msg.matches("\\s+\u0002GOOG\u0002\\s+.*".toRegex())) {
|
||||
hasGoog = true
|
||||
break
|
||||
}
|
||||
|
|
|
@ -94,9 +94,9 @@
|
|||
<li>Performing DNS lookups
|
||||
<div><code>mobibot: lookup www.apple.com</code></div>
|
||||
</li>
|
||||
<li>Retrieving stock quotes from <a href="https://www.alphavantage.co/">Alpha Avantage</a>
|
||||
<li>Retrieving stock quotes from <a href="https://finnhub.io/">Finnhub</a>
|
||||
<div><code>mobibot: stock GOOG</code></div>
|
||||
<div><code>mobibot: stock google</code></div>
|
||||
<div><code>mobibot: stock lookup alphabet inc</code></div>
|
||||
</li>
|
||||
<li>Displaying the time in various time zones
|
||||
<div><code>mobibot: time UK</code></div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue