Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cinchize compatibility? #1

Closed
rikai opened this issue Jul 14, 2013 · 16 comments
Closed

Cinchize compatibility? #1

rikai opened this issue Jul 14, 2013 · 16 comments

Comments

@rikai
Copy link
Contributor

rikai commented Jul 14, 2013

So i'm trying to get this cinch plugin to work with cinchize, specifically as part of showbot, but i cant seem to get it to work.

My cinchize.yml includes the following:

shared:
  cooldown:
    config:
      "#jb-test":
        global: "10"
        user: "20"

Which should be equivalent to:

c.shared[:cooldown] = { :config => { '#bottest' => { :global => 10 :user => 20 } }

I do indeed have require 'cinch-cooldown' and enforce_cooldown in the proper places, and the commands actually error if i get the syntax wrong with 'configuration_broken?': undefined method 'key?', so i can only assume i've gotten the syntax right... Is there something i'm missing or...? I'd rather like to use cinch-cooldown with cinchize. :)

@bhaberer
Copy link
Owner

I may make this a bit more error proof in the future (I didn't know anyone was actually using this) However, the config options need to import as symbols, not strings, try it in this format and see if things work better?

shared:
  :cooldown:
    :config:
      "#jb-test":
        :global: 10
        :user: 20

My current yml file looks like:

:cooldowns:
  '#dice':
    :global: 5
    :user: 10

and then in my bot init I have:

# Setup the cooldown if one is configured
if conf.key?(:cooldowns)
  c.shared[:cooldown] = { :config => conf[:cooldowns] }
end

However I just glanced over at cinchize and I'm not sure that it's pulling stuff into the shared hash, but I could be wrong... let me know if this helps!

@rikai
Copy link
Contributor Author

rikai commented Jul 14, 2013

Ahh, i missed that indeed, that likely would have indeed been a problem later, but it doesn't seem to be the root of the current issue as i just tested switching it over and it still does not seem to work.

I do have other plugins that pull from shared[], which comes from

servers:
  servername:
    shared:

as per the cinchize yml, and are working without issue, so i had assumed that would be enough, perhaps it isn't...? Not really quite sure what is going on.

@bhaberer
Copy link
Owner

Huh, alright. I'm not in a useful state for deep debugging tonight, but
I'll download and attempt to get cinchize working with cooldown tomorrow

Thanks for the heads-up.

On Sat, Jul 13, 2013 at 11:37 PM, rikai notifications@github.com wrote:

Ahh, i missed that indeed, that likely would have indeed been a problem
later, but it doesn't seem to be the root of the current issue as i just
tested switching it over and it still does not seem to work.

I do have other plugins that pull from shared[], which comes from

servers:
servername:
shared:

as per the cinchize yml, and are working without issue, so i had assumed
that would be enough, perhaps it isn't...? Not really quite sure what is
going on.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-20932471
.

  • Brian

@rikai
Copy link
Contributor Author

rikai commented Jul 14, 2013

No problem, thanks for the quick response and support, looking forward to using it! :)

@rikai
Copy link
Contributor Author

rikai commented Aug 6, 2013

Any update on this? :o

@bhaberer
Copy link
Owner

bhaberer commented Sep 4, 2013

Sorry I keep getting pulled onto other stuff. This is on my list tho :(

  • Brian

On Tue, Aug 6, 2013 at 11:03 AM, rikai notifications@github.com wrote:

Any update on this? :o

Reply to this email directly or view it on GitHub:
#1 (comment)

@rikai
Copy link
Contributor Author

rikai commented Feb 20, 2014

Ever get a chance to look into this? :)

@bhaberer
Copy link
Owner

Nope! But I'm working on things again.

I pushed a big rewrite, might want to give it a try just to make sure it's still being silly.

@rikai
Copy link
Contributor Author

rikai commented Apr 16, 2014

It indeed still does not work.

Might i suggest modeling after other, similar gems like cinch-identify? That gem works without issue with cinchize, and the way it's set up allows me to just specify options for the plugin like so:

    class: "Cinch::Plugins::Identify"
    options:
      :password: "blah" # Enter your password here
      :type: :nickserv # Most servers use nickserv, so setting this as the sane default.

Most other plugins i've used follow this setup as well, and it seems to work flawlessly with cinchize and is the expected way of doing things.

Also, rather than lib/cinch/plugin, lib/cinch/plugins also seems to be the standard directory used in most other cinch-related plugins and seems to be what is recommended for use by upstream.

I'm thinking with a few changes like that to bring it in line with what other plugins do, it should theoretically just work...

@rikai
Copy link
Contributor Author

rikai commented Apr 16, 2014

Ahh, i think i understand now why it's cinch/plugin rather than cinch/plugins, as you're actually modifying/overwriting the existing plugin functionality, right?

If thats the case, ignore that bit of my comment. I'm not the most experienced with plugins, so i'm just trying to follow what you're doing... 👍

I attempted to load cinch-cooldown like i would a standard plugin in cinchize.yml:

  plugins:
  -
    class: "Cinch::Plugin::Cooldown"

But it didn't seem very happy about that when i started it...:

/Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinch-cooldown-1.1.3/lib/cinch/plugin/cooldown.rb:11:in `+': can't convert Cinch::Bot into an exact number (TypeError)
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinch-cooldown-1.1.3/lib/cinch/plugin/cooldown.rb:11:in `initialize'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinch-2.0.12/lib/cinch/plugin_list.rb:11:in `new'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinch-2.0.12/lib/cinch/plugin_list.rb:11:in `register_plugin'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinch-2.0.12/lib/cinch/plugin_list.rb:16:in `block in register_plugins'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinch-2.0.12/lib/cinch/plugin_list.rb:16:in `each'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinch-2.0.12/lib/cinch/plugin_list.rb:16:in `register_plugins'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinch-2.0.12/lib/cinch/bot.rb:239:in `start'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinchize-0.4.2/lib/cinchize.rb:122:in `block in start'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinchize-0.4.2/lib/cinchize.rb:112:in `loop'
    from /Users/studio/.rvm/gems/ruby-1.9.2-p320/gems/cinchize-0.4.2/lib/cinchize.rb:112:in `start'
    from showbot_irc.rb:21:in `<main>'

I asusme this is either because of some conflict with loading plugins that override, or because it's not getting the config options required? I'm hoping its the latter, as that seems easier to fix.

@bhaberer
Copy link
Owner

Yea, this is not a traditional Cinch plugin as much as a hack to change how Cinch works on a lower level (the base Plugin module) . So you may have issues loading it in this way. I'll try to allocate some time to figure out why it's not loading it right. I've just been dealing with a lot of life craziness. :-\

@rikai
Copy link
Contributor Author

rikai commented May 28, 2014

It's not a problem, i've been dealing with moving and getting settled into a new job myself. Actually, the job uses the bot i'm trying to add the cooldown functionality to, amusingly enough... Regardless, i understand the lack of free time issue. :)

@rikai
Copy link
Contributor Author

rikai commented Aug 5, 2014

Just curious if there has been any progress on this, noticed some updates to master. :)

@rikai
Copy link
Contributor Author

rikai commented Apr 9, 2015

Just another bump, still looking to get this working. ;)

@rikai
Copy link
Contributor Author

rikai commented Aug 10, 2016

Just leaving a note here in case you're still interested in what's causing this issue and wanting to fix it.

We seem to have tracked tracked down the source of the issue over in rikai/Showbot#40. 👍

Still debating how to solve it though.

@bhaberer
Copy link
Owner

bhaberer commented Aug 19, 2016

@rikai @s0ph0s-2 See if that change works for you guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants