<Donovan>
I'm sure you probably already saw that, but theres an example
<ericson>
i took my on :message block in the main Bot.new function and moved it out to a plugin, tried some different things, but didn't work, i will try to take the exact hello script and try that and change it after it works...
<Donovan>
remember to require your external file (of course)
<ericson>
i had it all in the same file .... :/
<ericson>
thanks, ill try it when i get home
<Donovan>
ah, okay. I thought it stopped working after you moved it to an external plugin.
<ericson>
tried to do it as the example in the readme... :/
<Donovan>
yeah, that should work.
<Donovan>
check for errors in the output
<ericson>
i probably did something stupid, ill try again and check the errors i the output
<Donovan>
happens to me all the time. =)
<Donovan>
"Why is this not working?!?!... oh."
v0n has joined #cinch
v0n has quit [Read error: Operation timed out]
<Donovan>
okay, I think I'm missing something obvious here, but !help doesn't appear to be working.
<Donovan>
!help
<Donovan>
nevermind, got it
v0n has joined #cinch
rickmasta has joined #cinch
space_ has joined #cinch
Space has quit [Ping timeout: 245 seconds]
space_ has quit [Read error: Connection reset by peer]
rickmasta has quit [Quit: Leaving...]
kx has quit [Read error: Connection reset by peer]
Space has joined #cinch
kx has joined #cinch
<Donovan>
hmm... how can I find out what each plugin_name is?
<Donovan>
when set
<Donovan>
@bot.plugins.map { |p| p.plugin_name } gives me undefined method.
<ayonix>
i guess you could use something like @bot.plugins.map{ |p| p.class } though?
SamuelT has left #cinch [#cinch]
<Donovan>
yeah, that's what I'm doing currently.
<Donovan>
I added '!plugin list' to the PluginManagement plugin, it would be nice to be able to give the plugin_name when it's been defined in the plugin (for !help)
<Donovan>
plugin_name is defined in ClassMethods, but that doesn't really help
<Donovan>
that's so we can set it in the plugin itself.
<Donovan>
for example, the UrbanDict plugin uses "set :plugin_name 'urban'". So, you have to use !help urban (not !help UrbanDict).
<Donovan>
there's the working code if anyone wants it
<Donovan>
keep in mind it's been modified to work with my cinchbot
<dominikh>
Donovan: aw, my version could reload itself, why can't yours :)
<Donovan>
you sure?
<dominikh>
I am not going to answer that question :)
<Donovan>
=)
<dominikh>
The code is also sufficiently similar to mine that you probably want to add the correct copyright notes etc ;)
<dominikh>
(And yes, I'm sure, it can reload itself)
<Donovan>
I will, I've given you credit in the main notice too
<Donovan>
Hmm... I tried reloading it, but it failed. Unloaded but then wouldn't load (since it was unloaded).
<Donovan>
which is why I put the check in there
<dominikh>
thing is, when unloading a plugin, Cinch will wait for 10 seconds if the plugin still has running handlers
<dominikh>
sure, if it fails to load its new self within 10 seconds, it's gone, but I think that's unlikely?
<Donovan>
interesting, I'll try again then.
<dominikh>
(and of course it will only work with !reload. manual !unload + !load will bite you)
<Donovan>
maybe that's what happened, maybe it got an error on load
<Donovan>
speaking of copyright, I've given you credit in the readme, where else would you like to see your credit?
<Donovan>
I'm cool with wherever, since this is opensource MIT license.
<dominikh>
hm yeah, that'd be another case. I suppose it's sufficiently fragile that you might not want to use it :) For me it wasn't an issue because I've also got an !eval plugin, so I can inspect and fix the bot
<dominikh>
well, README should be sufficient (the canonical place is LEGAL). fwiw, that plugin is MIT too. the gist doesn't specify it (which implies full copyright), but I've stated to someone else before that it's MIT. so basically you'd state somewhere that file X is copyright me and licensed under the MIT
<Donovan>
cool, then I think we're golden. But if you see anything you're not happy about, by all means let me know.
<dominikh>
nah, pretty happy. just the usual morning pedantry :)
<Donovan>
understood.
<Donovan>
but I'll add a LEGAL file too, to list all the authors I've borrowed from