Advertisement
Shiny_

Untitled

Sep 3rd, 2014
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.33 KB | None | 0 0
  1. >Błędy:
  2.  
  3. C:\Users\Patryk\Dysk Google\Skrypty\Ruby>StatusBot.rb
  4. C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:88:in `initialize': no implicit conversion of Fixnum into String (TypeError)
  5.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:88:in `new'
  6.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:88:in `deserialize'
  7.         from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:104:in `visit_Psych_Nodes_Scalar'
  8.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
  9.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
  10.         from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
  11.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:268:in `block in revive_hash'
  12.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:266:in `each'
  13.         from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:266:in `each_slice'
  14.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:266:in `revive_hash'
  15.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:141:in `visit_Psych_Nodes_Mapping'
  16.         from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
  17.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
  18.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
  19.         from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:240:in `visit_Psych_Nodes_Document'
  20.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
  21.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
  22.         from C:/Ruby200-x64/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
  23.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych/nodes/node.rb:35:in `to_ruby'
  24.        from C:/Ruby200-x64/lib/ruby/2.0.0/psych.rb:130:in `load'
  25.         from C:/Users/Patryk/Dysk Google/Skrypty/Ruby/StatusBot.rb:10:in `<main>'
  26.  
  27. Plik yml:
  28. # StatusBot.yml
  29. URL: !ruby/regexp /https?:\/\/[\S]+/i"
  30.  
  31. Ładowanie w Rubym:
  32. YLoad           = YAML::load(File.open("StatusBot.yml"))
  33. UrlRegex        = YLoad["URL"]
  34.  
  35. Użycie w Rubym:
  36. on :action, UrlRegex do |msg|
  37.     msg.reply "#{msg.user} ♫ #{VideoTitle(msg.message)}" or msg.reply "#{msg.user} ♫ #{PlaylistTitle(msg.message)}"
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement