# plugin. You can create them directly in an IRC channel, and invoke them just
# like normal rbot plugins.
-
-Command = Struct.new( "Command", :code, :nick, :created, :channel )
-
+define_structure :Command, :code, :nick, :created, :channel
class ScriptPlugin < Plugin
super
if @registry.has_key?(:commands)
@commands = @registry[:commands]
+ raise unless @commands
else
@commands = Hash.new
end
begin
eval( code )
- rescue => e
+ rescue Exception => e
m.reply( "Script '#{name}' crapped out :(" )
m.reply( e.inspect )
end
# TODO allow different safe levels for different botusers
begin
eval( code )
- rescue => e
+ rescue Exception => e
m.reply( "Script '#{name}' crapped out :(" )
m.reply( e.inspect )
end
# TODO allow different safe levels for different botusers
begin
m.reply eval( code ).to_s
- rescue => e
+ rescue Exception => e
m.reply( "Script '#{name}' crapped out :(" )
m.reply( e.inspect )
end