Created
March 13, 2010 05:14
-
-
Save avescodes/331126 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Botfly.login(jabber_id,pass) do | |
on.message.nick(/Jim/).some_matcher(condition) do | |
# do actual message response, includes access to message contents, nick, time sent | |
end | |
join("omg_awesome_room").as(resource) do | |
on.join.room_status(/something/) do | |
# Likewise, but now we are in the context of a multi-user chat | |
# No shitting you, the way I'm building it you could literally spawn another room join, add a new responder, or even create an entirely new bot. | |
end | |
end | |
end | |
# I should not that in the context of every callback block one has access to class and instance variables for that responder - so its possible to keep state across calls to your responder | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment