Dominik Honnef

Cinch

Cinch is a Ruby framework for writing IRC bots in an object oriented way.

When I started working on Cinch (which was called Newton back then), I was aware of the vast number of already available frameworks, most prominently Isaac, Rbot and Autumn. None of these, however, could convince me. Their APIs were either overly simplified to the point of looking like an imperative programming language (in the case of Isaac), or overly complicated, in the cases of Autumn and Rbot, which feel a lot like pre-3.0 Rails, but for writing IRC bots.

Main focus when developing Cinch is put on providing a simple yet powerful API to the user, which makes use of available Ruby features and idioms. Furthermore, I try to hide IRC internals (e.g. numeric codes) as much as possible, while still allowing access to them if needed.

The general rule is that if an IRC feature exists, Cinch will provide methods for using it, so that the user will never have to send or receive raw IRC messages (even though that still remains possible).

For example, printing all hostnames of all users in a certain channel is as easy and intuitive as the following snippet:

# Channel(s) is a helper method available in the context of Cinch bots
# to convert strings to proper Channel objects
channel = Channel("#cinch")

channel.users.each_pair do |user, modes|
  puts user.host
end

Cinch will automatically keep track of joins, parts, quits and so on to automatically update channel and user objects.