dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.11
_whitelogger has joined #cinch
_whitelogger_ has joined #cinch
waxjar has joined #cinch
Rennex has joined #cinch
kimoto___ has joined #cinch
skybotal- has joined #cinch
Netfeed has joined #cinch
xeviox has joined #cinch
mpapis has joined #cinch
DonovanYoung has joined #cinch
FiXato|VPS has joined #cinch
literal has joined #cinch
krisbulman has joined #cinch
dominikh has joined #cinch
Cinchy has joined #cinch
thenut has joined #cinch
Dwarf has joined #cinch
catepillar has joined #cinch
onewheelskyward has joined #cinch
tempestas has joined #cinch
deb has joined #cinch
rikai has joined #cinch
catepillar has quit [Write error: Broken pipe]
timelord_cout has joined #cinch
krisbulman has quit [*.net *.split]
timelord_cout has quit [*.net *.split]
waxjar has quit [*.net *.split]
dominikh has quit [*.net *.split]
onewheelskyward has quit [*.net *.split]
tempestas has quit [*.net *.split]
timelord_cout has joined #cinch
onewheelskyward has joined #cinch
dominikh has joined #cinch
oddmunds has joined #cinch
mpapis has quit [*.net *.split]
xeviox has quit [*.net *.split]
_whitelogger has joined #cinch
_whitelogger has joined #cinch
_whitelogger has joined #cinch
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #cinch
_whitelogger has joined #cinch
_whitelogger has joined #cinch
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #cinch
_whitelogger has joined #cinch
_whitelogger has joined #cinch
_whitelogger has joined #cinch
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #cinch
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #cinch
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #cinch
_whitelogger has joined #cinch
Rennex has quit [*.net *.split]
leftylin1 has quit [Ping timeout: 272 seconds]
leftylink has joined #cinch
Netfeed has quit [*.net *.split]
leftylink is now known as Guest69675
Rennex has joined #cinch
rikai has joined #cinch
deb has joined #cinch
Rennex_ has joined #cinch
Rennex has quit [Ping timeout: 272 seconds]
Dwarf has quit [Ping timeout: 276 seconds]
FiXato|VPS has quit [Ping timeout: 276 seconds]
ayonix has joined #cinch
Netfeed has joined #cinch
Netfeed has quit [Ping timeout: 267 seconds]
ayonix has quit [Ping timeout: 240 seconds]
FiXato|VPS has joined #cinch
ayonix has joined #cinch
Dwarf has joined #cinch
krisbulman has joined #cinch
oddmunds has quit [Quit: WeeChat 0.4.2]
oddmunds has joined #cinch
ayonix_ has joined #cinch
ayonix has quit [Read error: Connection reset by peer]
krisbulman has quit [Ping timeout: 272 seconds]
[krisbulman] has joined #cinch
[krisbulman] is now known as krisbulman
Netfeed has joined #cinch
thenut has quit [Ping timeout: 276 seconds]
deb has quit [*.net *.split]
rikai has quit [*.net *.split]
awkisopen has quit [*.net *.split]
Netfeed has quit [*.net *.split]
nickrw has quit [*.net *.split]
timelord_cout has quit [*.net *.split]
txdv has quit [*.net *.split]
xeviox has quit [*.net *.split]
oddmunds has quit [*.net *.split]
kith has quit [*.net *.split]
catepillar has quit [*.net *.split]
newton has quit [*.net *.split]
Rennex_ has quit [*.net *.split]
kimoto___ has quit [*.net *.split]
krisbulman has quit [*.net *.split]
Dwarf has quit [*.net *.split]
FiXato|VPS has quit [*.net *.split]
Cinchy has quit [*.net *.split]
ayonix_ has quit [*.net *.split]
Guest69675 has quit [*.net *.split]
Valkyrie^ has quit [*.net *.split]
literal has quit [*.net *.split]
DonovanYoung has quit [*.net *.split]
_whitelogger has joined #cinch
_whitelogger has joined #cinch
_whitelogger has joined #cinch
mpapis has quit [Excess Flood]
Guest69675 is now known as leftylink
Rennex has joined #cinch
krisbulman has joined #cinch
waxjar has joined #cinch
Dwarf has joined #cinch
CM-Punk has joined #cinch
dominikh has joined #cinch
dominikh has quit [Changing host]
dominikh has joined #cinch
waxjar has quit [Ping timeout: 272 seconds]
waxjar has joined #cinch
krisbulman is now known as Guest13213
Valkyrie^ has quit [Read error: Connection reset by peer]
Guest13213 is now known as krisbulman
mpapis has joined #cinch
Dwarf has quit [Ping timeout: 272 seconds]
krisbulman has quit [Ping timeout: 272 seconds]
waxjar has quit [Ping timeout: 272 seconds]
Dwarf has joined #cinch
krisbulman has joined #cinch
waxjar_ has joined #cinch
mpapis has quit [Ping timeout: 261 seconds]
CM-Punk has quit [Ping timeout: 265 seconds]
CM-Punk has joined #cinch
waxjar_ has quit [Ping timeout: 265 seconds]
waxjar has joined #cinch
krisbulman has quit [*.net *.split]
Dwarf has quit [*.net *.split]
kludge` has joined #cinch
krisbulman has joined #cinch
Dwarf has joined #cinch
mpapis has joined #cinch
kludge` has quit [Changing host]
kludge` has joined #cinch
Dwarf has quit [Ping timeout: 272 seconds]
mpapis has quit [Ping timeout: 272 seconds]
Dwarf has joined #cinch
mpapis has joined #cinch
thews has joined #cinch
FiXato|VPS has joined #cinch
v0n has joined #cinch
deb has quit [*.net *.split]
rikai has quit [*.net *.split]
deb has joined #cinch
rikai has joined #cinch
Azure_ has joined #cinch
v0n has quit [Ping timeout: 272 seconds]
krisbulman has quit [Ping timeout: 272 seconds]
mpapis has quit [Ping timeout: 272 seconds]
leftylink has quit [Quit: leaving]
FiXato|VPS has quit [*.net *.split]
thews has quit [*.net *.split]
Dwarf has quit [*.net *.split]
Rennex has quit [Write error: Broken pipe]
Rennex has joined #cinch
xeviox is now known as xeviox|afk
thews has joined #cinch
thews has quit [Changing host]
thews has joined #cinch
mpapis has joined #cinch
Dwarf has joined #cinch
v0n has joined #cinch
[krisbulman] has joined #cinch
[krisbulman] is now known as 23LAA3PEH
FiXato|VPS has joined #cinch
onewheelskyward has joined #cinch
skybotalpha has joined #cinch
Azure_ is now known as Valkyrie^
Valkyrie^ is now known as Azure
Azure has quit [Quit: Textual IRC Client: www.textualapp.com]
Azure_ has joined #cinch
Rickmasta has joined #cinch
Azure_ has quit [Quit: Textual IRC Client: www.textualapp.com]
Azure_ has joined #cinch
Azure_ has quit [Max SendQ exceeded]
Azure_ has joined #cinch
Azure_ has quit [Max SendQ exceeded]
Azure_ has joined #cinch
Azure_ has quit [Max SendQ exceeded]
Azure_ has joined #cinch
Azure_ has quit [Max SendQ exceeded]
<CM-Punk> http://pastebin.com/C7d5Yv9Q I need help with this. When I attempt to use the command it doesn't work properly. It only sends the first word of the command to nickserv...
Azure_ has joined #cinch
Azure_ is now known as Azure
<onewheelskyward> Have you tried inspecting text before its sent?
<CM-Punk> Pardon? I'm sorry, I don't know what tht means. :P
<onewheelskyward> If you have a debugger, put a breakpoint before the nickserv send. If not, add puts text.inspect and make sure it contains what you think it does.
<dominikh> it'd help more if we knew the actual regexp used.
<CM-Punk> Sorry dominikh, I thought I included it, but I didn't. Here: match /ns (.+?) (.+)/, method: :execute_ns
<dominikh> your method takes two arguments, one message, one capture group. your regexp has two capture groups.
<dominikh> the first capture group will match up to the first space character
<dominikh> the second capture group, which you throw away, will match the rest
<CM-Punk> Oh that makes sense
<CM-Punk> So I should have one capture group, that looks like this: (.+)
<CM-Punk> ?
<dominikh> probably
<catepillar> and if it must contain a space
<catepillar> (.+ .+)
<CM-Punk> Okay, thank you!
<CM-Punk> It works.
<CM-Punk> I had another question :P
<CM-Punk> http://pastebin.com/GpaU3Q8i how do I make these "if"s even match if the case is wrong?
<catepillar> 1. downcase or upcase everything
<dominikh> a) these if on line 6 will never match. the keys are User objects, not strings
<catepillar> 2. if using a regex, add the //i option
<dominikh> b) Channel(m.channel) == m.channel
<dominikh> c) m.channel.users.has_key?(User(user))
<dominikh> well, or a ! before that to negate it
<dominikh> d) for the love of formatting, fix your indentation
<catepillar> lol
<catepillar> i was wondering why there were no method delcarations, and just thought they had accidently been removed when trimming it down for pastebin
<CM-Punk> On line six it's checking if the target user is in the channel
<dominikh> doesn't change anything of what I just said.
<dominikh> !eval Channel("#cinch").users.keys.first.class
<Cinchy> MathetesBot
<dominikh> !eval Channel("#cinch").users.keys[1].class
<Cinchy> Cinch::User
<dominikh> there, that one. the keys are User objects, not strings.
<dominikh> so m.channel.users.keys.include?(user) will never ever be true because `user` in your case is a string.
<CM-Punk> Well I mean, it works...
<dominikh> !eval Channel("#cinch").users.keys.include?("dominikh")
<CM-Punk> That part works...
<Cinchy> true
<dominikh> well.. fucking Ruby
<dominikh> it works, it's not clean :)
<dominikh> either way, see my c) again. it's not just cleaner, it solves your problem of case sensitivity. line 10 will be analogous, User(user) == m.user
<CM-Punk> Okay
<CM-Punk> So changing these things will fix case sensitivity?
<dominikh> yes
<CM-Punk> Okay, thanks dominikh
<dominikh> matter of fact, though, the include? one probably already was case insensitive. I hate the code I've written :)
<dominikh> !eval User("dominikh") == "dominikh"
<Cinchy> true
<dominikh> whoever coded that (me) is an idiot
<CM-Punk> What about line two
<onewheelskyward> Ah, past self code. Been there.
<CM-Punk> That's case sensitive too
<dominikh> onewheelskyward: past believes, really. it seemed like a great idea to allow every conceivable combination
<onewheelskyward> I could see the case for that.
<dominikh> CM-Punk: as I said, User(user) == m.user instead of user == m.user.nick – you will always want to compare actual User objects, not their nicks
<dominikh> onewheelskyward: yeah, that case is confusing people :)
<onewheelskyward> heh.
<dominikh> onewheelskyward: I think the moment when you don't get why an array full of User objects returns true for #include?(some_string) is a good moment to regret your choices
<onewheelskyward> yeah that string thing is a little non-deterministic
<onewheelskyward> Like, I'm not sure what to expect from it
<catepillar> !eval User("catepillar").nick
<catepillar> :(
<onewheelskyward> Object to object collection? Sure.
<dominikh> to be fair, I spent the last 1.5 years in a statically typed language, so I'm biased towards that nowadays
<dominikh> catepillar: it's not sandboxed, ergo only I can use it
<catepillar> i figured as much
<CM-Punk> Okay well
<CM-Punk> Is there any way to parse the user argument back down to a user object?
<CM-Punk> Uhm...for example I say
<CM-Punk> ~slap DOMINIKH
<dominikh> I showed you how to do that three times in the last 10 minutes :)
<CM-Punk> No
<CM-Punk> For the response
leftylink has joined #cinch
<CM-Punk> Just hear me out pls :P
<dominikh> ...
<dominikh> go ahead.
<CM-Punk> So I say ~flower DOMINIKH or something like that
<CM-Punk> I want the bot to respond with
* CM-Punk gives dominikh a flower
<CM-Punk> not
* CM-Punk gives DOMINIKH a flower
<dominikh> !eval User("DOMINIKH").nick
<Cinchy> "dominikh"
<catepillar> seems about right
<catepillar> that's what *should* happen
<CM-Punk> Right, I know the code recognizes it....
<CM-Punk> Here, hold on
Keli has joined #cinch
<CM-Punk> Okay this is the code you helped me with, just nao
<CM-Punk> ~revive DOMINIKH
* Keli throws a Phoenix Down on DOMINIKH, effectively reviving them!
<dominikh> !eval @bot.on(:message, /^~flower (.+)/) {|m, user| m.channel.action("gives #{User(user).nick} a flower")}; nil
<Cinchy> nil
<dominikh> ~flower DOMINIKH
* Cinchy gives dominikh a flower
<CM-Punk> AHHHHH
<CM-Punk> #{User(user).nick} within the response
<CM-Punk> I have
<CM-Punk> #{user}
<dominikh> obviously `user` is still the string you originally passed in, unless you set the variable to a new value.
<dominikh> !eval @bot.handlers.last.pattern
<Cinchy> Exception: undefined method `last' for #<Cinch::HandlerList:0x00000001f6e338>
<dominikh> !eval @bot.handlers.each.last.pattern
<Cinchy> Exception: undefined method `last' for #<Enumerator:0x0000000277eff0>
<dominikh> *sigh* where's magic when you need it
<onewheelskyward> !eval @bot.handlers.inspect
<onewheelskyward> !eval puts @bot.handlers.inspect
<dominikh> still not sandboxed, still only for me to use
<onewheelskyward> Smart.
<CM-Punk> ~revive DOMINIKH
<onewheelskyward> If you figure out sandboxed ruby, let me know. :)
* Keli throws a Phoenix Down on dominikh, effectively reviving them!
<CM-Punk> Ahaha
<CM-Punk> There we go
<CM-Punk> ~part
Keli has left #cinch [#cinch]
<dominikh> !eval @bot.handlers.unregister(@bot.handlers.find(:message).last)
<Cinchy> [#<Cinch::Handler @event=:message pattern=#<Cinch::Pattern:0x000000025a2d80 @prefix=nil, @pattern=/^~flower (.+)/, @suffix=nil>>]
<dominikh> no more flowers.
<CM-Punk> Baw
<onewheelskyward> :(
<CM-Punk> :P
<dominikh> onewheelskyward: well, there are several solutions, but none of which would allow me to manipulate the bot's state ;)
<onewheelskyward> Right.
<dominikh> sandboxing for the purpose of executing untrusted code? Dia on OS X, or some container solution (docker et al) for Linux
<CM-Punk> By the way dominikh, your Plugin Management plugin has been a life saver
<dominikh> yeah, it's pretty neat
<CM-Punk> I don't have to keep shutting down my bot to change things in the code
<CM-Punk> So, thank you so much, I am learning :D
<onewheelskyward> oh, what's that all about?
<leftylink> I wanted to make it so that with one line similar to match /blahblah/, :method => :blahblah I can have the bot respond to "!blahblah" publicly, "blahblah" privately, and "botsnick: blahblah" publicly
<leftylink> I decided to do https://gist.github.com/leftylink/8791843
<Cinchy> [gist] multiple matchers in one (at gist.github.com, leftylink on 2014-02-03 20:34)
<leftylink> seem reasonable?
<CM-Punk> onewheelskyward, who?
<onewheelskyward> Plugin management.
<dominikh> leftylink: almost reasonable – even though I'd probably #dup the args hash for every method call. I don't know if anything stores the hashes you pass in
<dominikh> or if we'll ever do.
<leftylink> ah
<leftylink> it currently works because code currently uses values_at but can't hurt to do that for future proofing
<dominikh> yeah
<dominikh> it'd also be the sort of bug you'd never find
<CM-Punk> Except for the obvious changes I made
<leftylink> yeah good idea. guess I'll do that now
<dominikh> and the missing license note :P
<CM-Punk> Oh
<CM-Punk> dominikh mad
<CM-Punk> I can add it....if I can find the original again
<dominikh> yeah, that's going to be hard, the original never included licensing information :D
<CM-Punk> XDDD
<dominikh> to be frank I don't care, the code is fairly trivial
<CM-Punk> To you it may be, to me it was something I was working on forever and couldn't do it, then someone gave that to me I was like ":DDD"
<dominikh> it helps to have an understanding of the underlying APIs of Cinch
<CM-Punk> Yeah, and you would have that :)
<dominikh> most of the time, yeah.
<CM-Punk> XDD
<onewheelskyward> Coooool.
<onewheelskyward> dominikh++
<CM-Punk> Other times you're like "I hate that code"
<dominikh> right.
<dominikh> I guess code that is 3 years old does that to you.
<CM-Punk> I added the security checks, but that's not as awesome as dominikh's root code
postmodern has joined #cinch
<dominikh> to be fair, the version of it that I use has ACL functionality
<CM-Punk> I can't use the reload function though.
<CM-Punk> What's ACL dominikh?
<CM-Punk> XD
<dominikh> access control list
<CM-Punk> Oh
<CM-Punk> Okay
<onewheelskyward> It'd require a little tweaking to work with my deploy, but it looks useful.
<CM-Punk> dominikh, if I could think of a better and just as secure way to do access I would have done it :(
<CM-Punk> But as I keep saying, I'm self-learning everything here, with help from you guys
<dominikh> my way is similar (checking auth name, as well as channel names), it's just wired more directly into plugins. i.e. https://github.com/dominikh/Mathetes/blob/cinch_rewrite/lib/cinch/plugins/eval.rb#L6 that line enables ACLs for the plugin and https://github.com/dominikh/Mathetes/blob/cinch_rewrite/bot.rb#L149 configures the ACL for that plugin
<dominikh> the rest is managed via hooks
<CM-Punk> http://pastebin.com/1maXeCv9 like I've been coding this and can't get it to work
* CM-Punk looks
<CM-Punk> Okay, that makes sense dominikh, I like it. Mine is using a helper as you saw, but like with https://github.com/Namasteh/Eve-Bot/blob/master/lib/eve/plugins/plugin_management.rb using the reload causes the bot to hang because it's like a double whois and the servers rate limit it
<CM-Punk> Then it never uses a function that uses "check_user" again until I restart it
<leftylink> hmm, what if i were to take my thing a step further
<leftylink> I want to use the xmatch across multiple plugins, but without having to paste that code into each plugin. do I make something in the style of Cinch::Plugin that can be included in and that contains xmatch?
<dominikh> that'd be the cleanest approach
<leftylink> all right
<onewheelskyward> I've been getting closer with plugin unit testing.
<onewheelskyward> All it's required so far is a complete refactor. :)
<dominikh> of your plugins or of cinch?
<CM-Punk> heh
<CM-Punk> So dominikh, other than the misplaced
<leftylink> oh plugin testing
<leftylink> I considered cinch-test
<leftylink> but I just kinda rolled my own
<dominikh> fwiw, Cinch itself has no test suite, and I'm not a big tester, so yeah… no idea how easily plugins are tested
<leftylink> it was not too terrible
<leftylink> created fake Message, User, Channel classes
<leftylink> use rspec to stub out various functions in Cinch::Bot and the plugin
<dominikh> so in essence you mocked/stubbed most of cinch
<leftylink> yeah
Netfeed has quit [Changing host]
Netfeed has joined #cinch
_whitelogger_ has joined #cinch
catepill1r has joined #cinch
oddmunds1 has joined #cinch
_whitelogger has quit [Ping timeout: 245 seconds]
oddmunds has quit [Ping timeout: 245 seconds]
catepillar has quit [Ping timeout: 245 seconds]
newton has quit [Ping timeout: 245 seconds]
newton has joined #cinch
<onewheelskyward> dominikh The plugins.
<CM-Punk> I fixed google.rb
<CM-Punk> :D
catepill1r is now known as catepillar
v0n has quit [Ping timeout: 272 seconds]
oddmunds1 is now known as oddmunds
v0n has joined #cinch
<CM-Punk> With this: http://pastebin.com/9K8xZdvR how do I make "%s%s%s%s%s%s bold as well?
v0n has quit [Read error: Connection reset by peer]