dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.3.1 | You're being logged at https://irclog.whitequark.org/cinch/
td512 has quit [Ping timeout: 240 seconds]
td512 has joined #cinch
td512 has joined #cinch
td512 has quit [Changing host]
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cyrus has joined #cinch
<Cyrus> It's not super clear from the docs on how to sanely test if a user is online before sending them a message. Anyone got any tips?
<Cyrus> Nevermind, got it, User('username').online
<Cyrus> I probably should have read the source before asking. >_>
<leftylink> ah see I was thinking you were asking that because http://www.rubydoc.info/gems/cinch/Cinch/User#online-instance_method told you " this information cannot be ensured to be always correct." in which case I was out of ideas
<Cyrus> Nope, I simply needed to check if the user was online before sending a message to the channel. Fairly simple.
<Cyrus> This is such a great framework.
td512 has quit [Ping timeout: 240 seconds]
td512 has joined #cinch
td512 has joined #cinch
td512 has quit [Changing host]
td512 has quit [Ping timeout: 240 seconds]
adamprice has joined #cinch
<adamprice> hello cinch! i've gotten myself into a bit of a pickle with cinch plugins. i want my plugins to respond to bang commands as well as responding when mentioned by name. how can i have my plugins match on the bot's irc nick, if the plugins are being loaded before the bot is finished being configured? is it possible to load plugins after the bot has initialized and connected to a server to obtain a nick?
<leftylink> adamprice: my answer off the top of my head is that you can make the prefix a lambda; the one arg the lambda gets called with is the Message, and you can use Message#bot and then Bot#nick to get the nickname
<leftylink> and that will allow you to make the prefix a regex that matches either ! or the bot's current nick
<adamprice> oo fancy
<adamprice> leftylink, okay cool thank you for the suggestion! i'll give it a go
<leftylink> adamprice: one example I see in th examples dir is https://github.com/cinchrb/cinch/blob/master/examples/plugins/lambdas.rb#L12 and so that's fine if doing it per-plugin. You can set it globally though by doing `c.plugins.prefix = lambda { |m| whatever }`
<adamprice> oops ... i thought i looked through the examples!
<adamprice> <_<
<leftylink> the c.plugins.prefix line would go in `configure do |c|` block
<adamprice> leftylink, fantastic! that example is exactly what i'm looking for
<leftylink> thumbs up emoji
td512 has joined #cinch
td512 has joined #cinch
td512 has quit [Changing host]
adamprice has left #cinch ["WeeChat 1.9.1"]
Azure has joined #cinch
Azure has quit [Quit: Oops.]