Skip to content

Instantly share code, notes, and snippets.

@avescodes
Created March 13, 2010 05:14
Show Gist options
  • Save avescodes/331126 to your computer and use it in GitHub Desktop.
Save avescodes/331126 to your computer and use it in GitHub Desktop.
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