tcpbot/plugins/wip/PrivMsg.rb

22 lines
467 B
Ruby

require 'cinch'
require_relative '../classes/Util.rb'
class PrivMsg
include Cinch::Plugin
include Util::PluginHelper
set :prefix, /^:/
extend Hooks::ACLHook
@@levelRequired = 10
match /msg ([^\s]+) (.+)/, method: :msg
def msg(m, target, words)
return unless aclcheck(m)
to = nil
if(target.match /^\#/) # target is channel
to = Channel(target)
else
to = User(target)
end
to.send(words)
end
end