Sha256: 6d49e4ee90e9848bcbe4565319049977d4eddd0718577c5e8ca8e9847c234070

Contents?: true

Size: 662 Bytes

Versions: 13

Compression:

Stored size: 662 Bytes

Contents

# coding: utf-8

module Bitbot::TipStats
  def on_tipstats(m)
    stats = db.get_tipping_stats

    str = "Stats: ".irc(:grey) +
      "tips today: " +
      satoshi_with_usd(0 - stats[:total_tipped]) + " " +
      "(#{stats[:total_tips]} tips) "

    if stats[:tippers].length > 0
      str += "biggest tipper: ".irc(:black) +
        stats[:tippers][0][0].irc(:bold) +
        " (#{satoshi_with_usd(0 - stats[:tippers][0][1])}) "
    end

    if stats[:tippees].length > 0
      str += "biggest recipient: ".irc(:black) +
        stats[:tippees][0][0].irc(:bold) +
        " (#{satoshi_with_usd(stats[:tippees][0][1])}) "
    end

    m.reply str
  end
end



Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
tipjar-0.1.196 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.195 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.194 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.193 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.192 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.191 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.19 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.18 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.171 lib/bitbot/plugin/tipstats.rb
tipjar-0.1.16 lib/bitbot/plugin/tipstats.rb
bitbot-0.0.4 lib/bitbot/plugin/tipstats.rb
bitbot-0.0.3 lib/bitbot/plugin/tipstats.rb
bitbot-0.0.2 lib/bitbot/plugin/tipstats.rb