def execute(m, args = nil)
return unless self.class.responds_to_command?(bot)
network = bot.config.server
channel = m.channel&.name
return unless channel
outcome = RdocGenerate.handle(
args,
root: RABBOT_ROOT,
admin_allowed: self.class.admin_allowed?(
network: network,
channel: channel,
nick: m.user.nick,
is_op: m.channel.opped?(m.user)
)
)
case outcome
in [:async, ack, job]
flood_safe_reply(m, ack, with_progress: false)
AsyncJob.run(label: "rdoc") do
themed_flood_safe_reply(m, RdocReport.format_result(job.call), plugin: "rdoc")
end
in [:error, message]
flood_safe_reply(m, message, with_progress: false)
end
end