Only return BTC 15m, etc. if different from current price.
This commit is contained in:
parent
df7384570e
commit
87cb58102a
2 changed files with 7 additions and 5 deletions
|
@ -124,9 +124,11 @@ class Bitcoin(bot: Mobibot) : ThreadedModule(bot) {
|
|||
val symbol = bpi.getString("symbol");
|
||||
with(messages) {
|
||||
add(PublicMessage("BITCOIN: $symbol" + bpi.getDecimal("last") + " [$currency]"))
|
||||
add(NoticeMessage(" 15m: $symbol" + bpi.getDecimal("15m")))
|
||||
add(NoticeMessage(" Buy: $symbol" + bpi.getDecimal("buy")))
|
||||
add(NoticeMessage(" Sell: $symbol" + bpi.getDecimal("sell")))
|
||||
if (bpi.getBigDecimal("15m") != bpi.getBigDecimal("last")) {
|
||||
add(NoticeMessage(" 15m: $symbol" + bpi.getDecimal("15m")))
|
||||
add(NoticeMessage(" Buy: $symbol" + bpi.getDecimal("buy")))
|
||||
add(NoticeMessage(" Sell: $symbol" + bpi.getDecimal("sell")))
|
||||
}
|
||||
}
|
||||
return messages
|
||||
} catch (e: IOException) {
|
||||
|
|
|
@ -46,10 +46,10 @@ class BitcoinTest : LocalProperties() {
|
|||
var messages = marketPrice("USD")
|
||||
assertThat(messages).`as`("not empty").isNotEmpty
|
||||
assertThat(messages[0].msg).`as`("bitcoin & $").startsWith("BITCOIN").contains("$")
|
||||
assertThat(messages[1].msg).`as`("15m").contains("15m")
|
||||
//assertThat(messages[1].msg).`as`("15m").contains("15m")
|
||||
|
||||
messages = marketPrice("GBP")
|
||||
assertThat(messages[0].msg).`as`("£").contains("£").contains("GBP")
|
||||
assertThat(messages[1].msg).`as`("GBP 15m").contains("15m")
|
||||
//assertThat(messages[1].msg).`as`("GBP 15m").contains("15m")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue