cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

Raw 482 Event Handler #138

Closed uberdragon closed 10 years ago

uberdragon commented 10 years ago

Added event handler for the "You're not a channel operator" error when the bot attempts to perform a channel operator command but does not currently have OP status in the channel.

Usage:

on :no_channel_op do |m|
  m.reply "Sorry I can't I don't have OPs"
end
dominikh commented 10 years ago

I don't think we should add event names for these kind of numerics. It's already possible to use the numeric directly and there's the ERR_CHANOPRIVSNEEDED constant for this particular numeric.

(I did type out a nicer message, but GitHub somehow lost it.)

uberdragon commented 10 years ago

Understood, I didn't realize numerics were directly available