#ruby-lang - Thu 12 Apr 2007 between 19:05 and 19:12

NY Lost Funds



ehirdmessage.where in messages -> the channel, to join a channel, just #conn.join(channel)
message.where in #blah is "#blah", in #abc "#abc"
epigeneticahh
so it's more like an event than a message
ehirdWell, message is for messages to a channel
epigeneticmessage sounds like the text of a message in the channel
ehird;-)
Look below - i add a callback for messages with that method
epigeneticright.. intuitively though, message to me means the text
not a compound object
ehirdthat's #content
but, you can name it whatever you want in your collback of course
epigeneticyes
ehirdExtra connections are a problem, yes - But you could use an array and loop through them... quite ugly though
epigeneticthe point i'm making though is that as a convention, you should pick something other than "message" for your examples and documentation
because users will usually follow the conventions of the author
ehirddocumentation? what's that
Nwallinsi think it has something to do with the North pole and elves
shevyor
lazy ppl
epigeneticpersonally, i really liked the way twisted handled IRC... it was a class with methods like "privmsg(event)" and "user_joined(event)", and you implemented the methods that you wanted to watch for events.
err... a class that you'd subclass
ehirdmine is pretty similar
except you explicitly define the events
epigeneticsubclassing is neater :)
and you can always just call one of those callback methods you were using from the subclass
ehirdsubclassing doesn't allow freedom of how you implement stuff
you could do a lambda, for instance (And the library does that itself, for its tiny PING handler)
epigeneticclass MyIRC < IRC; def on_privmsg(event); handle_message(event.channel); end; end;
sure you can :)
ehirdmeh
epigeneticjust call it from the class' method
ehirdi like my way better
:P
epigeneticbut isn't your way just like all the other ruby ones?
ehirdI don't think so. I never really liked the other APIs
epigeneticme either
ehirdMine's nice and simple, a thin layer on top of the protocol
epigenetictrue, it's not as ugly
it's missing that major thing though -- multiple servers

Page: 2 9 16 23 30 37 44 51 58 65 72 79 

IrcArchive

NY Lost Funds