27 lines
580 B
Ruby
27 lines
580 B
Ruby
class Mod_Relay < Vrobot4::Module::Module
|
|
def self.type() "Relay" end
|
|
Vrobot4::Module.add_module_type self
|
|
|
|
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
|