dominikh changed the topic of #cinch to: The IRC Framework | http://groups.google.com/group/cinch-ruby/ | Latest version: Cinch 2.0.3 – Change log at http://bit.ly/Oqu9Eu – Migration guide at http://bit.ly/GO4qkW | This channel is being publicly logged at http://irclog.whitequark.org/cinch/
opus has joined #cinch
opus has quit [Quit:]
opus has joined #cinch
postmodern has joined #cinch
opus has quit [Quit:]
robotmay has quit [Ping timeout: 276 seconds]
opus has joined #cinch
robotmay has joined #cinch
robotmay has quit [Ping timeout: 276 seconds]
robotmay has joined #cinch
robotmay has quit [Read error: Connection reset by peer]
aytch has quit [Read error: Connection reset by peer]
opus has quit [Quit:]
aytch has joined #cinch
<Divinite> dominikh: Here?
<dominikh> Divinite: yea
<Divinite> dominikh: Need a little bit of help making user authentication and "settings"
<dominikh> heh
<Divinite> Any recommendations?
<dominikh> yes. more concrete questions :P
<Divinite> How can I make cinch "recognise" a userv
<Divinite> *?
<dominikh> if on a network with Q (quakenet) or nickserv, you can use User#authname
<Divinite> What do you mean?
<dominikh> on those networks, a user will have an account, and log in, so you can use that to verify him.
<Divinite> But how do I check they're verified?
<dominikh> by looking at User#authname?
<Divinite> How do I look at it?
<dominikh> By calling the authname method on a User object?
<Divinite> Thanks!
<Divinite> Secondly, how can I store a user's settings?
<dominikh> what settings
<Divinite> For instance:
<Divinite> Divinite has points: 4938
<dominikh> save them to disk, load them from disk on bot start
opus has joined #cinch
<Divinite> Yaml?
<dominikh> for example
<Divinite> Any other way apart from YAML?
<dominikh> any other serialization, databases, whatever floats your boat
<Divinite> I'd prefer just a static file
<dominikh> then use yaml
<Divinite> Thanks for the advice!
<aytch> YAML, maybe CSV? CSV would probably be simpler
<Divinite> aytch: In what way?
<aytch> YAML was kind of hard for me to grasp at first
<Divinite> aytch: Does CSV use an external gem?
<dominikh> save yourself the trouble, don't use CSV
<Divinite> dominikh: Alright, thanks
<aytch> listen to that guy
<dominikh> that's generally a good idea, yeah :P
opus has quit [Quit:]
v0n has joined #cinch
<v0n> hi
<v0n> does the bot #plugins.plugins method can accept an array of class names as strings?
<v0n> like c.plugins.plugins = ["PluginFoo", "PluginBar"]
<dominikh> no.
<dominikh> c.plugins.load(plugins: ["Foo", "Bar"]) should work though
<dominikh> (#load being a method of the Configuration class for loading/merging configuration from a hash)
<v0n> ho ok, gonna test it
<aytch> dominikh: do you think there would be any value in being able to pass a name to a thread?
<dominikh> aytch: what?
<aytch> Well, right now I'm trying to identify syllable strings with regex. I have to figure out which @event=:message pattern=#<Cinch::Pattern:0x007fbf9b8afb30 message is being triggered
<dominikh> the pattern should give you an idea, shouldn't it? and you can add debug statements in your methods
<v0n> dominikh: can this #load method "reloads" the plugins?
<dominikh> no. load simply "loads" a hash into the configuration. the list of plugins only gets evaluated once, when the bot starts
<v0n> btw I confirm #load works as expected with an array of strings :)
<dominikh> :)
<v0n> ho yes, I read somewhere that cinch doesn't actually support "hot reload" of plugins
<v0n> I will have to kill and restart the bot, right?
<dominikh> well, it does. just not in the core
<dominikh> you can very well write reloading code, and I did
<dominikh> it just expects a very certain file system layout
<dominikh> remove line 5, take note of line 16, note the issue at line 52 and you're set
<dominikh> hot reloading of plugins. Cinchy here has reloaded plenty of plugins without a restart
<aytch> that would be a pretty awesome addition to the cinch core
<dominikh> I disagree. there's more than one way to reload code, there are limitations, and one of Cinch's philosophy is to not expect any file system layout. that there expects one
<dominikh> it's really not something I want to maintain "for everybody"
<aytch> I can understand that philosophy.
<aytch> as a new programmer, I spend a lot of time testing my failing plugins, so for myself personally, it's a thing I'd like to see - but I do understand your reasoning.
<dominikh> well, you can use that code there. it's a plugin
<dominikh> it just won't be in core.
<aytch> And I most certainly shall :D
<v0n> dominikh: interesting! I find I'm gonna use this plugin manager with only the load feature
<v0n> dominikh: btw, how are plugins loaded at startup?
<dominikh> v0n: essentially, we take c.plugins.plugins, instantiate the classes and register the patterns
<v0n> dominikh: but you have to initialize kind of a "load" command, right?
<dominikh> including Cinch::Plugin pulls in an initialize class method, as well as a bunch of register code
<v0n> dominikh: so you meant that I can do a "load" in the initialize() method of the PluginManager?
<dominikh> v0n: what exactly are you trying to do?
<v0n> dominikh: we want to have plugins in a plugins/ directory, and implement a "!reload" command, that actually reload every plugins under that folder
fridim has joined #cinch
<v0n> we alors want the bot to load the plugins on startup as well, for sure
<dominikh> look at https://github.com/dominikh/Mathetes/blob/cinch_rewrite/lib/cinch/plugins/plugin_management.rb again then, and add some globbing and be done with it
<dominikh> it shows you how to load and how to reload
<dominikh> all you need to do is iterate over the files in the dir
<dominikh> and run the right code
<v0n> yep ok
<v0n> the I should also call PluginManagement.load(every_plugins_files) before bot.start
<v0n> cool thanks
v0n has quit [Ping timeout: 264 seconds]
opus has joined #cinch
opus has quit [Client Quit]
jhaals has joined #cinch
robotmay has joined #cinch
robotmay has quit [Ping timeout: 272 seconds]
<Lemtzas> How would I determine if someone is an operator (or similar) in a channel?
robotmay has joined #cinch
jhaals has quit []
jhaals has joined #cinch
jhaals_ has joined #cinch
jhaals has quit [Ping timeout: 245 seconds]
jhaals_ is now known as jhaals
jhaals has quit []
v0n has joined #cinch
Uranio has joined #cinch
jhaals has joined #cinch
jhaals has quit [Ping timeout: 276 seconds]
jhaals has joined #cinch
v0n has quit [Ping timeout: 240 seconds]
kith_ has joined #cinch
kith has quit [Ping timeout: 252 seconds]
<Uranio> the Message class have some way for know who IRC client use the user trigged
<Uranio> ??
v0n has joined #cinch
v0n has quit [Quit: WeeChat 0.4.0]
<brandon|work> yes, it does
<brandon|work> Uranio: http://pastebin.com/Df7EFst9
<Uranio> brandon|work: ep... that say the nick
<Uranio> I mean IRC client using by the user
<brandon|work> ahhh, a /whois
<brandon|work> It looks like cinch does have that method
v0n has joined #cinch
<Uranio> int my csae, inside the do
<Uranio> m.user.nick return the nick
<Uranio> but...
<Uranio> m.user.refresh (or whois) return nil
<Uranio> and cause a axception
<Uranio> brandon|work: what do you thing about it?
<brandon|work> Not sure. Your best bet would be to ask dominik
<brandon|work> he's usually active later in the day
<Uranio> dominikh: hi! oh, powerfull sorcerer... are you in there?
<waxjar> Uranio, you're trying to figure out what IRC client people use?
<Uranio> YES!
<Uranio> waxjar: that the point
<Uranio> for exmaple, sa the to the bot !who fulano
<Uranio> actually it return the IP adress
<waxjar> that's a CTCP feature, you can listen to :ctcp events and parse them yourself
<waxjar> Cinch doesn't provide a method for it, I think
jhaals has quit []
<Uranio> waxjar: my server is special... don't allow ctcp and/or querys
<waxjar> see #ctcp_message, #ctcp_args and #ctcp_command on Cinch::Message.
<waxjar> oh, then you can't check a user's client Uranio :)
<Uranio> waxjar: cool :/
<waxjar> the IRC protocol doesn't support it
<Uranio> waxjar: would be posible exec IRC server commands from the bot?
<dominikh> bot.irc.send "foo" sends a raw command foo
<Uranio> VREY GOOD!
<Uranio> %s/VREY/very/g
Uranio has quit [Quit: while you reading this, a kitty dies]
robotmay has quit [Ping timeout: 276 seconds]
robotmay has joined #cinch
robotmay has quit [Ping timeout: 248 seconds]
Uranio has joined #cinch
<Uranio> hi, me againm.. exist any event that trigged when anybody join to a channel
<Uranio> waxjar: ^
<dominikh> :join
<dominikh> naturally
<Uranio> xD
robotmay has joined #cinch
<Uranio> are the events ni the doc??
<Uranio> dominikh: ^
<Uranio> %s/ni/in/g
<dominikh> if rubydoc.info didn't keep screwing me over, yeah... but since it refuses to list any additional doc files, you'll have to do with the raw file on github: https://github.com/cinchrb/cinch/blob/master/docs/events.md
<Uranio> dominikh: I'm using the local ruby doc, look very complete but not talk about events
<dominikh> Uranio: in the Files tab there should be an entry named Events
<dominikh> if not, it's not complete :P
<Uranio> yep.. :join is not in there
<dominikh> try reading :)
<dominikh> it mentions three kind of events
<Uranio> but the work join is not in there
<dominikh> ...
<dominikh> I repeat myself
<dominikh> try reading
<dominikh> "1. Events mapping directly to IRC commands" and "We will not further describe all possible events of the first two categories"
* Uranio carfully reading as RTFM
<dominikh> there's no point in listing all possible irc commands, you (should) already know them. there's join, so there's an event :join
<dominikh> same for part, kick, topic, etc
<dominikh> if there's an irc command, there's an event
<Uranio> yee... their are "mapped"
<Uranio> and there is special named cathall
<Uranio> dominikh: so.. for example, if a /mode is exec
<Uranio> m.user.nick would be.. the nick moded
<Uranio> and m.message the mode?
<dominikh> certainly not. m.user.nick would be whoever invoked the mode
<dominikh> a mode change can affect multiple targets, including ones that aren't users but the channel directly
<dominikh> but yes, m.message would be the raw mode string
<Uranio> cool
<dominikh> there's a more abstract event :mode_change (which is documented there)
txdv has quit [Read error: Connection reset by peer]
<dominikh> and there's abstractions on top of that such as :op when someone gets opped etc
txdv has joined #cinch
<Uranio> ye see it, but was traying to understand the catchall
<dominikh> ye
<Uranio> dominikh: Cinch don't use eventmachine, so... you write a events system from scratch?
<dominikh> yes
<dominikh> and cinch doesn't use an event loop. handler invocations happen in new threads
<dominikh> brb
<Uranio> dominikh: what you would use for manage events except eventmachine
<dominikh> no idea
<Uranio> is very slow :-/
robotmay_ has joined #cinch
robotmay has quit [Ping timeout: 255 seconds]
robotmay has joined #cinch
robotmay_ has quit [Ping timeout: 260 seconds]
Uranio has quit [Quit: while you reading this, a kitty dies]
opus has joined #cinch
opus has quit [Quit:]
opus has joined #cinch
v0n has quit [Quit: WeeChat 0.4.0]
opus has quit [Quit:]
opus has joined #cinch
opus has quit [Quit:]
opus has joined #cinch
v0n has joined #cinch
kith_ is now known as kith
opus has quit [Quit:]
postmodern has quit [Quit: Leaving]
postmodern has joined #cinch
postmodern has quit [Quit: Leaving]
opus has joined #cinch