dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.11
<shadesaaaa> see the documentation, iirc there's a document on timers
[krisbulman] is now known as krisbulman
* thews goes to check
<shadesaaaa> if not, there's definitely some examples :)
<thews> shadesaaaa: didn't see it in the main docs but found the example, thanks
shadesaaaa is now known as waxjar
<waxjar> np :)
<waxjar> i wonder how my nick got changed. hmm :p
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
v0n has joined #cinch
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
v0n has quit [Ping timeout: 264 seconds]
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
v0n has joined #cinch
v0n has quit [Ping timeout: 264 seconds]
Spami has joined #cinch
xeviox|afk is now known as xeviox
Spami has quit [Read error: Connection reset by peer]
werebutt has joined #cinch
werebutt has left #cinch [#cinch]
kludge` has quit [Ping timeout: 264 seconds]
kludge` has joined #cinch
Xeago has joined #cinch
<Xeago> I can't figure out how to get the helpers (channel/user/etc) to be available
<dominikh> they are available in plugins automatically.
<Xeago> how do I get them available on my repl?
<dominikh> I have no idea how you're using Cinch in a REPL or what your context is.
<Xeago> require 'cinch'; bot = Cinch::Bot.new; … ; bot.start
<Xeago> omitted configuration for brevity
<dominikh> well, for one you won't be able to do anything after bot.start, because it blocks, second you can't expect the helpers to work in random places such as the global namespace.
<Xeago> ^C after .start works just fine, and I can do bot.user_list.find_ensured "Xeago"
<Xeago> I don't expect it to without a require, but I can't find the require
<dominikh> it won't work with a require, either. and pretty sure that "^C after .start" doesn't work "just fine". You're aborting what that method is doing…
<Xeago> looking at #start, only the reconnect will be affected
<Xeago> which is fine for my testing
<Xeago> in any case
<Xeago> looking at how to write plugins then
<Xeago> include Cinch::Plugin should make them available?
<Xeago> (for that plugin?)
<dominikh> yes.
<Xeago> I don't understand how that works
<Xeago> including Cinch::Plugin which has a require 'cinch/helpers'
<Xeago> but I can't seem to load that?
<Xeago> dominikh: would you mind explaining the ruby fu that is going on there?
<Xeago> dominikh: using Configuration#load
<Xeago> how do I specify the array of plugins?
<dominikh> as an array of classes. or strings, which will be looked up and turned into classes.
<Xeago> {plugins: [Plugin]} {plugins: {plugins: [Plugin]}} both don't work
<Xeago> do I need to OpenStruct the inner {plugins: [Plugin]} ?
<dominikh> I don't even know what "to OpenStruct" means. You also didn't show how exactly you're calling #load
<Xeago> yea, openstructing it works
<Xeago> bot.config.load(…)
<Xeago> to OpenStruct: OpenStruct.new(…)
<dominikh> {plugins: {plugins: [Plugin]}} should work just fine.
<Xeago> where … is any of the 2 hashes I provided
<Xeago> that gives me NoMethodError: undefined method `plugins' for {:plugins=>[Hello]}:Hash
<Xeago> when I then call #start
<dominikh> sounds like a bug.
<Xeago> am using cinch-2.0.11
<dominikh> yeah, it's a bug *shrug*. use OpenStruct, I doubt anyone is going to fix it anytime soon.
<Xeago> NoMethodError: undefined method `plugins' for {:plugins=>[Hello]}:Hash from /Users/TwN/.gem/ruby/2.0.0/gems/cinch-2.0.11/lib/cinch/bot.rb:239:in `start'
<Xeago> ok, using openstruct isn't too difficult I guess
<Xeago> thanks!
[krisbulman] is now known as krisbulman
<Xeago> is there a preference for using "on :symbol" vs listen_to :symbol
<dominikh> you won't be using `on` in plugins.
<Xeago> so on :symbol is used only in the block for Bot#new?
<dominikh> you can call it directly on a bot instance, too.
<dominikh> usually you shouldn't be using `on` for anything.
<Xeago> ok I see, the suggested approach is thus to use plugins for anything but trivial runnable examples
<dominikh> yes.
CM-Punk has quit [Ping timeout: 245 seconds]
v0n has joined #cinch
<Xeago> when using match //
<Xeago> can I get the MatchData object that would be the result of that regex from the message object?
<Xeago> it is in @matches, but that doesn't have an accessor
<dominikh> no you can not, and that's not what's in @matchers (I don't know any @matches). every capture group will be one argument to the called method, but there's no MatchData object stored or passed around.
<Xeago> https://gist.github.com/Xeago/d43dcfab1796188b86ed is the message object which @matches which is a hash
<Cinchy> [gist] gist:d43dcfab1796188b86ed (at gist.github.com, Xeago on 2014-01-27 14:30)
<Xeago> how would I get the part of the message w/o the prefix?
<Xeago> as I don't want my code to deal with the prefix
<dominikh> match /(...)/ and everything sans the prefix is in the first group
<Xeago> which MatchData should I get that from then? the one that is in Message@matches (see gist) includes the prefix
<dominikh> I didn't say to get it from any MatchData. I said that every capture group will be passed as an argument to the method for that match
<Xeago> okay, leave the fact I talked about MatchData
<Xeago> so my method should take multiple arguments then?
<dominikh> yes.
<Xeago> ah
<Xeago> this is next level design
<Xeago> loving it
<Xeago> thanks!
<dominikh> np
UberDragon has joined #cinch
krisbulman is now known as krisbulman|otp
xeviox is now known as xeviox|afk
krisbulman|otp is now known as krisbulman
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
Xeago has quit [Remote host closed the connection]
krisbulman is now known as krisbulman|afk
krisbulman|afk is now known as [krisbulman|afk]
Guest58437 has joined #cinch
<Guest58437> Hi guys, just started using #cinch, having some trouble replying back to messages
<Guest58437> I create a channel #koding-test, not sure what mode it needs to have...disabled n to allow external messages
<catepillar> i think it's n
<catepillar> i would have to double check that though
<catepillar> yea, it's +n
<catepillar> or are you asking for other modes for the channel?
<Guest58437> catepillar: i enabled +n, still can't send messages
<Guest58437> catepillar: do i need to set any other mode to let cinch send messages?
<catepillar> is the channel on freenode?
<Guest58437> yea #koding-test
Guest58437 is now known as sent-hil
<sent-hil> catepillar: thanks! that worked
postmodern has joined #cinch
[krisbulman|afk] is now known as krisbulman
krisbulman is now known as krisbulman|afk
sent-hil has left #cinch [#cinch]
v0n has quit [Read error: Operation timed out]
UberDragon has quit [Quit: UberDragon]
krisbulman|afk is now known as krisbulman