nerdmaster / ruby-irc-yail Goto Github PK
View Code? Open in Web Editor NEWNet::YAIL (Yet Another IRC Library) for Ruby - low-level IRC library
Home Page: http://ruby-irc-yail.nerdbucket.com/
Net::YAIL (Yet Another IRC Library) for Ruby - low-level IRC library
Home Page: http://ruby-irc-yail.nerdbucket.com/
NoMethodError doesn't really make sense for optional elements, such as what was happening with event.from on prefix-free NOTICE messages. It's probably worth auditing the code to see where it makes sense to have a nil default rather than having exceptions get thrown. In 1.5.x this may be a much bigger problem as the events will be more directly exposed to the users.
The kick doesn't work. I use the IRCBot class.
Here is my code :
def _in_msg(event)
return if event.pm?
return if event.nick != "marvin"
if event.message =~ /^.+: chamber . of 6 => .*\*BANG\*.*$/
nick = event.message.scan(/^[^:]+/)[1]
@irc.kick(nick, event.channel)
end
end
And the error :
/home/erdnaxeli/.rvm/gems/ruby-1.9.3-p374/gems/net-yail-1.6.0/lib/net/yail/legacy_events.rb:192:in
legacy_process_event': undefined method
reason' for #<Net::YAIL::OutgoingEvent [kick]:0x00000003039528> (NoMethodError)
from /home/erdnaxeli/.rvm/gems/ruby-1.9.3-p374/gems/net-yail-1.6.0/lib/net/yail/dispatch.rb:19:indispatch' from (eval):3:in
kick'
from /home/erdnaxeli/codaz/Sheraf/lib/sheraf.rb:47:in `_in_msg'
I try with two or three arguments (4 arguments raise an exception and kill the bot), but I only got this message :
I, [2013-02-25T23:39:14.243887 #22488] INFO -- : Unknown raw 461 from irc.iiens.net: KICK Not enough parameters
There is the code (remove the third argument for the two arguments version) :
@irc.kick(nick, event.channel, nick)
Secondly, if I change one of the nick argument to a string, I got a "no such nick/channel" message.
@irc.kick(nick, event.channel, 'test') => Unknown raw 401 from irc.iiens.net: test No such nick/channel
@irc.kick('test', event.channel, nick) => Unknown raw 401 from irc.iiens.net: test No such nick/channel
This needs to be looked into, as the current system is based almost entirely on the original source YAIL was written out of. It doesn't seem to always be working.
When I tried to connect to irc.hackint.eu:6697 with SSL it failed with the message:
net-yail-1.6.1/lib/net/yail/message_parser.rb:68:in
initialize': undefined method split' for nil:NilClass (NoMethodError)
This would add filters and some terrible magic. On joining a channel, request a user list. When anybody parts / quits / joins / etc (other messages?), update user list.
Nothing in the main docs talks about log levels
I have all the log with or without :silent.
Futhermore, you say :silent is deprecated, but how can I set the log level without use :silent ?
According to the documentation, puts will end everything with a "record separator usually a LF".
However, according to RFC1459:
"IRC messages are always lines of characters terminated with a CR-LF (Carriage Return - Line Feed) pair, and these messages shall not exceed 512 characters in length, counting all characters including the trailing CR-LF."
As such the definition for raw should be something like:
def raw(line, report = true)
@socket.send "#{line}\r\n", 0
report "bot: #{line.inspect}" if report
end
(Note that one could also use @socket.write, I just used send).
I found this out because the server I was trying to connect to claimed that I was not sending it a password, despite the fact that I could see it was sending it. At first I thought it was some sort of timing issue, due to the fact that once I put the password send right after the socket creation it worked, but it turned out that I had just ended the command with CRLF because that's what I'm used to doing with text protocols. Thankfully I noticed what it was before I submitted a bug report for the server password not working properly.
I'm not sure if most servers will accept both LF and CRLF as a line ending. However, the particular server I was connecting to didn't. (The server is one of justin.tv's IRC servers for the record).
I've forked it and will perform a pull request.
i use create_command and get below result.
`legacy_process_event': Unknown outgoing event: #<Net::YAIL::OutgoingEvent [whois]:0x00000000eb6680> (RuntimeError)
something wrong w/ my define?
@irc.create_command :whois, "WHOIS :nick", :nick
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.