lib/bitbot/plugin.rb in tipjar-0.1.16 vs lib/bitbot/plugin.rb in tipjar-0.1.18
- old
+ new
@@ -13,11 +13,11 @@
require 'bitbot/plugin/update_addresses'
require 'bitbot/plugin/update_exchange_rates'
require 'bitbot/plugin/txfee'
require 'bitbot/plugin/doc'
require 'bitbot/plugin/online'
-require 'bitbot/plugin/prize'
+# require 'bitbot/plugin/prize'
class Bitbot::Plugin
include Cinch::Plugin
include Bitbot::Common
@@ -31,53 +31,64 @@
include Bitbot::UpdateAddresses
include Bitbot::UpdateExchangeRates
include Bitbot::Txfee
include Bitbot::Doc
include Bitbot::Online
- include Bitbot::Prize
+# include Bitbot::Prize
def initialize(bot)
super
Bitbot::Database.new(File.join(config['data']['path'], "bitbot.db")).upgrade_schema()
end
set :prefix, ""
#
- # Private messages
+ # Private messages ~ replies sent via PRIVMSG
#
match /^help(.*)$/, :method => :on_help, :react_on => :private
match /^balance$/, :method => :on_balance, :react_on => :private
match /^history$/, :method => :on_history, :react_on => :private
match /^withdraw(.*)$/, :method => :on_withdraw, :react_on => :private
match /^deposit$/, :method => :on_deposit, :react_on => :private
- match /^\+tip\s+(\w+)\s+([\d.]+)\s+?(.*)/, :method => :on_tip, :react_on => :private
+ match /^ping$/, :method => :on_ping, :react_on => :private
+# match /^\+prize\s+(\w+)\s+([\d.]+)\s+?(.*)/, :method => :on_prize, :react_on => :private
#
- # Channel messages
+ # Private messages ~ replies sent via channel
#
+ match /^\+tip\s+(\w+)\s+([\d.]+)\s+?(.*)/, :method => :on_tip, :react_on => :channel
+
+ #
+ # Channel messages ~ replies sent via channel
+ #
match /^\+help(.*)$/, :method => :on_help, :react_on => :channel
match /^\+tipstats$/, :method => :on_tipstats, :react_on => :channel
match /^\+tip\s+(\w+)\s+([\d.]+)\s+?(.*)/, :method => :on_tip, :react_on => :channel
- match /^\+doc$/, :method => :on_tipstats, :react_on => :channel
- match /^\+ticker$/, :method => :on_tipstats, :react_on => :channel
+ match /^\+doc$/, :method => :on_doc, :react_on => :channel
+ match /^\+ticker$/, :method => :on_ticker, :react_on => :channel
+ match /^\+txfee$/, :method => :on_txfee, :react_on => :channel
+ match /^\+version$/, :method => :on_version, :react_on => :channel
#
+ # Channel messages ~ replies sent via PRIVMSG
+ #
+ match /^\+balance$/, :method => :on_balance, :react_on => :private
+ match /^\+help$/, :method => :on_help, :react_on => :private
+ match /^\+history$/, :method => :on_history, :react_on => :private
+
+ #
# Timer jobs
#
timer 60, :method => :on_update_exchange_rates
timer 60, :method => :on_update_addresses
- timer 10, :method => :on_prize_win_check_balance
+# timer 10, :method => :on_prize_win_check_balance
#
# Also run the timer jobs on connect
#
listen_to :connect, :method => :on_update_exchange_rates
listen_to :connect, :method => :on_update_addresses
- listen_to :connect, :method => :on_online
- listen_to :connect, :method => :on_doc
+# listen_to :connect, :method => :on_online
+# listen_to :connect, :method => :on_doc
- #
- # Run these jobs on every channel message
- #
- listen_to :channel, :method => :on_prize
end