dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.2.6
sarkyniin has joined #cinch
sarkyniin has quit [Quit: Quit]
cats has quit [Ping timeout: 256 seconds]
cats has joined #cinch
CodeGnome_ has joined #cinch
<CodeGnome_> Hi folks. I'm trying to voice users in a channel when a condition is met, but `m.channel.voice(nick)` complains "uninitialized constant Channel (NameError)"
<CodeGnome_> How do I get at the current channel where there was a :join event?
v0n has quit [Ping timeout: 246 seconds]
<CodeGnome_> Gist showing the problem: https://gist.github.com/CodeGnome/418e42a6fa58bfdfac31
v0n has joined #cinch
<CodeGnome_> wb v0n
<leftylink> CodeGnome_: well this is awkward. that code works just fine on this network
<leftylink> so it seems the code is correct
<leftylink> well I'm not being precise; I just have this: on :join { |m| m.channel.voice(m.user) }
<leftylink> but that worked
<leftylink> er
<leftylink> with braces the :join needs parentheses, oops
<leftylink> yeah works... on(:join) { |m| m.channel.voice(m.user) }
<CodeGnome_> leftylink: I'm not sure why mine isn't working, though.
<CodeGnome_> Seems like it should.
proxnal has quit [Ping timeout: 256 seconds]
proxnal has joined #cinch
cats has quit [Ping timeout: 250 seconds]
cats has joined #cinch
<CodeGnome_> leftylink: I think it was a problem with the conditional. I've got it sorted now. Thanks. :)
CodeGnome_ has left #cinch [#cinch]
cats has quit [Ping timeout: 240 seconds]
cats has joined #cinch
greenbigfrog has joined #cinch
greenbigfrog is now known as green-big-frog
green-big-frog is now known as greenbigfrog
postmodern has joined #cinch
_whitelogger___ has joined #cinch
_whitelogger__ has quit [Ping timeout: 240 seconds]
postmodern has quit [Quit: Leaving]
sarkyniin has joined #cinch
sarkyniin has quit [Ping timeout: 246 seconds]
sarkyniin has joined #cinch
_whitelogger___ has joined #cinch
sarkyniin has quit [Ping timeout: 244 seconds]
sarkyniin has joined #cinch
sarkyniin has quit [Ping timeout: 260 seconds]
sarkyniin has joined #cinch
sarkyniin has quit [Read error: Connection reset by peer]
eebs has joined #cinch
cats has quit [Quit: Wow, rude.]
sarkyniin has joined #cinch
sarkyniin has quit [Quit: Quit]
_djbkd has joined #cinch
postmodern has joined #cinch
sarkyniin has joined #cinch
CodeGnome_ has joined #cinch
<CodeGnome_> Hi, all. I'm trying to get Cinch to reload/restart with an exec, but this doesn't work: `exec Dir.join(Dir.pwd, $0) if m.user.nick == $owner`
<CodeGnome_> Is there a good way to have Cinch reload itself, with or without a disconnect?
<eebs> I'm not sure about reloading itself, but if you'd like to minimize reconnects you could use an IRC bouncer like ZNC: http://wiki.znc.in/ZNC
<CodeGnome_> eebs: I'm talking about the ability to make changes to the bot.
<dominikh> why does exec not work?
<dominikh> exec would work (except for the "no disconnect" part. but put a proxy in front of it and people wouldn't notice)
<CodeGnome_> dominikh: No idea. I've tweaked it a lot. Right now I get "undefined method `join' for Dir:Class (NoMethodError)"
<CodeGnome_> Probably need File.join.
<dominikh> well that's not a Cinch error then.
<CodeGnome_> But it wasn't working before, either.
<CodeGnome_> But yeah...let me fix that and try again.
<CodeGnome_> Okay...that sort of works, but I don't get a clean exit. I don't really see a way to bot.exit and still call exec.
<CodeGnome_> It just breaks the TLS connection.
<dominikh> if you're going for restarts that nobody from the outside can observe, you will want a proxy such as znc in front of it. if you want a clean restart that doesn't trigger until all outgoing messages have be sent etc, that's not really possible right now iirc
<CodeGnome_> Would `bot.exit and exec File.join(Dir.pwd, $0) if m.user.nick == $owner` work? I don't care about whether the restarts are seen; I just want them clean.
<CodeGnome_> I think bot.exit would stop processing, though, so I'm not sure that it would work.
<eebs> exit isn't a method on Bot, is it?
<dominikh> you'd have to wait for your call to Bot#start to return. certainly doable, just more complex than those two lines :)
<CodeGnome_> eebs: Sorry, it's `bot.quit`, but yes it is.
<eebs> k, just making sure I was looking at the right version and that nothing had changed ;)
<CodeGnome_> Will bot.quit exit the current script, or can it be chained to an exec?
<dominikh> even if it didn't, Bot#quit doesn't wait until the bot actually disconnected, so it wouldn't work one way or another.
<eebs> You could implement your own hot-reloading via your own ruby code
<CodeGnome_> Isn't there some way to join the thread or wait on the process, then?
<CodeGnome_> eebs: I don't see any real hooks for that, and I don't want to reimplement the whole thing.
<leftylink> I'll tell you what I do... I just run in screen this command: while [ -f stay-connected ]; do ruby bot.rb; sleep 3; done
<dominikh> you need to do something like http://sprunge.us/RORc (completely untested, probably not correct Ruby.)
<CodeGnome_> leftylink: But I don't always want it to restart. This is for the use case where I've added a new command, and want it to take effect.
<leftylink> CodeGnome_: mmm... but would you ever want it to NOT restart?
<CodeGnome_> Generally, if I quit the bot, I want it dead. So, yes.
<eebs> You can look at what Autumn does, it support hot-reloading: https://github.com/RISCfuture/autumn/blob/master/libs/foliater.rb#L53
<leftylink> I see. well in such cases I rm stay-connected
<leftylink> and then the bot will stay dead
<leftylink> or ctrl c it /me shrugs
sarkyniin has quit [Ping timeout: 264 seconds]
sarkyniin has joined #cinch
sarkyniin has quit [Quit: Quit]
sarkyniin has joined #cinch
CodeGnome_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Weethus has quit [Quit: WeeChat 1.3-dev]
Zarthus has quit [Quit: ZNC 1.7.x-git-196-5faaf67 - http://znc.in]
Zarthus has joined #cinch
Elysia has joined #cinch
Elysia has quit [Client Quit]
Elysia has joined #cinch
eebs has quit [Quit: Leaving.]
Windir has quit [Ping timeout: 264 seconds]
_djbkd has quit [Quit: My people need me...]
Windir has joined #cinch
_djbkd has joined #cinch
head8debian has quit [Ping timeout: 272 seconds]
head8debian has joined #cinch
head8debian has quit [Changing host]
head8debian has joined #cinch