dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
_whitelogger has joined #cinch
frdmn has quit [Quit: ssssSSSSssss]
frdmn has joined #cinch
postmodern has quit [Quit: Leaving]
kith_ has joined #cinch
Rickmast- has joined #cinch
cyrusdav- has joined #cinch
iamayam has quit [*.net *.split]
catepillar has quit [*.net *.split]
kith has quit [*.net *.split]
Edelwin has quit [*.net *.split]
Rickmasta has quit [*.net *.split]
cyrusdavid has quit [*.net *.split]
iamayam has joined #cinch
kith_ has quit [Read error: Connection reset by peer]
kith has joined #cinch
catepillar has joined #cinch
Netfeed has quit [Ping timeout: 264 seconds]
Netfeed has joined #cinch
Netfeed has quit [Changing host]
Netfeed has joined #cinch
Edelwin has joined #cinch
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
xeviox|afk is now known as xeviox
rikai has quit [Ping timeout: 255 seconds]
rikai has joined #cinch
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
xeviox is now known as xeviox|afk
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
postmodern has joined #cinch
<Gizmokid2005>
this feels like a dumb question, but what to use to get the bot's current nick in an "on :message" method?
<dominikh>
bot.nick
<Gizmokid2005>
ie = on :message, /hello #{Bot.nick}/i do |m|
<Gizmokid2005>
will that still work there dominikh?
<Gizmokid2005>
I thought I tried that and got an error..
<dominikh>
if your variable is called bot, sure.
<Gizmokid2005>
Hmm, it is. Maybe I had a dumb.
<Gizmokid2005>
Hmmm, bot is defined as follows: bot = Cinch::Bot.new do
<Gizmokid2005>
and the message line: on :message, /hello #{bot.nick}/i do |m|
<Gizmokid2005>
but it gives me undefined method 'nick' for nil:NilClass when I do it on that line...
<dominikh>
well *that* won't work.
<dominikh>
the handler is defined before bot exists, or before bot has connected anywhere or has gotten a name
<Gizmokid2005>
That's what I was thinking but my thinker is a bit slow today...
<Gizmokid2005>
is there a way to do what I'm looking to accomplish? or should I regex it and just handle it within the message block to check if it matches the bot's nick?
<dominikh>
you could use a lambda for the pattern. on :message, lambda { |m| /hello #{m.bot.nick}/i } do |m|
<dominikh>
should work, anyway
<Gizmokid2005>
Hm, lemme try that dominikh
<Gizmokid2005>
Odd. It seems to be just not-firing at his point.
<Gizmokid2005>
Though I'm not convinced I did it correctly either.
djbkd has quit [Remote host closed the connection]
<dominikh>
hm, doesn't seem to work.
<dominikh>
oh.
djbkd has joined #cinch
<dominikh>
looks like only the plugin API supports lambdas, not the "on" DSL
<dominikh>
sorry, but it's time for bed here. look at the plugin examples; there should be one for lambdas, too. night
<Gizmokid2005>
thanks dominikh. Will do.
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]