cinchrb / cinch

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

Firing a method when the bot joins a channel #90

Closed samstarling closed 12 years ago

samstarling commented 12 years ago

Hi, what's the best way to get Cinch to perform an action (such as setting the topic of a channel) as soon as it joins the channel?

dominikh commented 12 years ago

Either on :join {|m| if m.user == bot; ... } or listen_to :join and the same comparison in your listen method, depending on whether you are using the on handlers, or plugin classes.

And please refrain from asking questions on the bug tracker. This place is for reporting bugs and requesting features only. If you have questions, feel free to hop by in #cinch on freenode or send me an email.

Cheers

samstarling commented 12 years ago

Thanks - I'll do that in future, rather than opening an issue.