dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
rikai has quit [Ping timeout: 240 seconds]
rikai has joined #cinch
djbkd has joined #cinch
sarkyniin has joined #cinch
<sarkyniin> hi
<sarkyniin> does anyone know how I would join a channel when someone invites me?
<sarkyniin> I can't see an event for that
<sarkyniin> on the events page
<dominikh> the event would be :invite
<sarkyniin> oh
<sarkyniin> does it take any parameters
<sarkyniin> additional I mean
<dominikh> unfortunately not
<dominikh> you'll have to look in m.params yourself
<sarkyniin> dominikh: how would I do that?
<sarkyniin> I'm just beginning in cinch
<dominikh> params is an attribute of Message. the one argument passed to your handler.
<sarkyniin> dominikh: is there a recorded list of all the parameters in params?
<dominikh> print it and take a look
<dominikh> it depends on the command
<leftylink> oh, are there relevant parameters when being invited to a channel, other than the channel?
<dominikh> there are other parameters in m.params, probably, not sure. none that are relevant
<dominikh> I don't remember the syntax of INVITE right now.
_BlizzyBot has joined #cinch
Blizzy has joined #cinch
Blizzy is now known as _Blizzy
<sarkyniin> dominikh: it's a list
<sarkyniin> the first element is the name of the person who invited
<sarkyniin> the second one is the channel
<dominikh> ah, there we go
<sarkyniin> yeah, thanks
<sarkyniin> another question, how would I get a user's hostname?
<dominikh> User#host
<sarkyniin> thanks
<sarkyniin> dominikh: how would I go about banning an user?
<sarkyniin> m.ban user doesn't work
<sarkyniin> nor does m.kick user
<dominikh> Please read through http://rubydoc.info/gems/cinch/index – in this case, http://rubydoc.info/gems/cinch/Cinch/Channel – it wouldn't make sense for a message to know how to ban someone. people get banned from channels.
<Gizmokid2005> sarkyniin: having just started myself, look at the examples on github too, they'll probably help a lot :)
<sarkyniin> dominikh: so I'd go "Channel.ban("user")?
<dominikh> I doubt your variable containing an instance of Channel is called Channel, so no.
<catepillar> Channel("#channel').ban "dominikh"
<catepillar> :p
<dominikh> for example.
<sarkyniin> oh
<sarkyniin> I could also do m.channel.ban "user"
<sarkyniin> right
<dominikh> yes.
<dominikh> on :message { |m| m.channel.ban(m.user) } for the best channel ever.
<sarkyniin> lol
<Gizmokid2005> dominikh: at least ban them with a hilarious message :D
<sarkyniin> on :message, /!kb (.+)/ do |m, query|
<sarkyniin> m.channel.ban query
<sarkyniin> m.channel.kick query
<sarkyniin> end
<sarkyniin> I'm using this right now, it's giving me an error
<dominikh> I'd very much suggest /^!kb and not /!kb
<sarkyniin> [2014/07/14 01:39:42.550] !! /usr/local/lib/ruby/gems/2.1.0/gems/cinch-2.1.0/lib/cinch/mask.rb:17:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)
<dominikh> otherwise this: "!kb foo" will still trigger it.
<dominikh> also probably needs to be User(query), not query
<sarkyniin> oh, thanks
<dominikh> not sure that's the reason
<Gizmokid2005> ^^ and be careful with that as you're not going to have a very effective ban in my testing either
sarkyniin has quit [Quit: Quitte]
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
rikai has quit [Ping timeout: 240 seconds]
rikai has joined #cinch
rikai has quit [Ping timeout: 240 seconds]
_BlizzyBot has quit [Read error: Connection reset by peer]
_Blizzy has quit [Ping timeout: 240 seconds]
frdmn has quit [Quit: ssssSSSSssss]
frdmn has joined #cinch
postmodern has quit [Quit: Leaving]
Rennex has quit [Ping timeout: 260 seconds]
Rennex has joined #cinch
tekk has quit [Ping timeout: 260 seconds]
kith_ has joined #cinch
kith has quit [Disconnected by services]
kith_ is now known as kith
tekk has joined #cinch
frdmn has quit [Quit: ssssSSSSssss]
frdmn has joined #cinch
frdmn has quit [Quit: ssssSSSSssss]
frdmn has joined #cinch
Zackio has quit [Ping timeout: 260 seconds]
Zackio has joined #cinch
Zackio has quit [Ping timeout: 260 seconds]
_Blizzy has joined #cinch
Zackio has joined #cinch
Zackio has quit [Ping timeout: 260 seconds]
Zackio has joined #cinch
<Gizmokid2005> If I was going to create a memo plugin and want to check every message's user to see if they have a message pending, would "listen_to :message" be an appropriate place to start?
<dominikh> there's a memo example that comes with Cinch.
<Gizmokid2005> I see that, but it's not pluginized
<Gizmokid2005> that's the only thing that I"m not sure of right now.
<dominikh> there's not much difference between `on` and plugins. on handlers with regexps use match, on handlers without use listen_to
<Gizmokid2005> that was my question :)
<Gizmokid2005> glad I'm not completely dumb
iamayam has quit [Ping timeout: 240 seconds]
iamayam has joined #cinch
djbkd has joined #cinch
iamayam has quit [Ping timeout: 240 seconds]
iamayam has joined #cinch
<Gizmokid2005> is there a way when doing a match in a plugin to tell what the match was on? ie - match /(?:msg|tell|ask) (.+?) (.+)/, method: :memo
<Gizmokid2005> is there a way to tell if it was msg, tell or ask that triggered when in :memo?
<dominikh> don't use ?: and look at the capture group?
<Gizmokid2005> I recognize some of those words dominikh...I'm not entirely sure what you're suggesting though.
<dominikh> … how do you tell what he said after msg/tell/ask?
<dominikh> the (.+) part
<Gizmokid2005> right
<dominikh> so do the same thing for msg|tell|ask?
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
postmodern has joined #cinch
postmodern has joined #cinch
postmodern has quit [Changing host]
<onewheelskyward> For instance, the function called for match /(msg|tell|ask) (.+)/ would have two add'l params: execute(cinch_msg_obj, msg_tell_ask, other_stuff)
djbkd has quit [Remote host closed the connection]
<Gizmokid2005> I think that actually makes sense...
<onewheelskyward> Ok. Give it a go. :)
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
leftylink is now known as leftylinkkkkkkkk
leftylinkkkkkkkk is now known as leftylink
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Ping timeout: 264 seconds]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
Edelwin has quit [Ping timeout: 245 seconds]
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]
djbkd has joined #cinch