diff options
author | Yaohan Chen <hagabaka@nanomachine.STUDENT.cwru.edu> | 2008-03-21 10:47:30 -0400 |
---|---|---|
committer | Yaohan Chen <hagabaka@nanomachine.STUDENT.cwru.edu> | 2008-03-21 10:47:30 -0400 |
commit | fdf1bc954352f19818f5f9f1c86643a2f8ef40c6 (patch) | |
tree | 5133ca5713af2b4aa756ad6c63a46db3fe141e66 /data/rbot/plugins/script.rb | |
parent | 2181f8f40f6dfc1ca7e48d82c0dfdcde6436ce72 (diff) | |
parent | 9a98a241d33d405bb104d27357af64afd4d5e6b2 (diff) |
Merge branch 'master' of ssh://ruby-rbot.org/var/git/rbot
Diffstat (limited to 'data/rbot/plugins/script.rb')
-rw-r--r-- | data/rbot/plugins/script.rb | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/data/rbot/plugins/script.rb b/data/rbot/plugins/script.rb index 5e2f1e58..c994d4da 100644 --- a/data/rbot/plugins/script.rb +++ b/data/rbot/plugins/script.rb @@ -70,29 +70,31 @@ class ScriptPlugin < Plugin def handle_eval( m, params ) code = params[:code].to_s.dup.untaint - Thread.start { - # TODO allow different safe levels for different botusers - begin - eval( code ) - rescue Exception => e - m.reply( "Script '#{name}' crapped out :(" ) - m.reply( e.inspect ) - end - } + Thread.start { + # TODO allow different safe levels for different botusers + begin + eval( code ) + rescue Exception => e + m.reply( "Script '#{name}' crapped out :(" ) + m.reply( e.inspect ) + end + } + m.replied = true end def handle_echo( m, params ) code = params[:code].to_s.dup.untaint - Thread.start { - # TODO allow different safe levels for different botusers - begin - m.reply eval( code ).to_s - rescue Exception => e - m.reply( "Script '#{name}' crapped out :(" ) - m.reply( e.inspect ) - end - } + Thread.start { + # TODO allow different safe levels for different botusers + begin + m.reply eval( code ).to_s + rescue Exception => e + m.reply( "Script '#{name}' crapped out :(" ) + m.reply( e.inspect ) + end + } + m.replied = true end @@ -111,7 +113,7 @@ class ScriptPlugin < Plugin command = Command.new( code, nick, created, channel ) @commands[name] = command - m.reply( "done" ) + m.okay end @@ -127,7 +129,7 @@ class ScriptPlugin < Plugin end @commands.delete( name ) - m.reply( "done" ) + m.okay end |