vrobot4/source/modules/relay.rb

27 lines
580 B
Ruby
Raw Normal View History

2019-02-23 16:18:39 -08:00
class Mod_Relay < Vrobot4::Module::Module
def self.type() "Relay" end
2019-02-23 22:43:50 -08:00
Vrobot4::Module.add_module_type self
2019-02-23 16:18:39 -08:00
def initialize info
super
end
def send_relay m
if @info.include? m.chan.id
@info.each do |ch|
if ch != m.chan.id
m.serv.bot.send_message ch, "<#{m.user.name}/#{m.chan.name}> #{m.msg}"
end
end
end
end
def on_message m
send_relay m if not super m
end
def on_command m, cnam, argv
send_relay m if not super m, cnam, argv
end
end