Closed nTraum closed 10 years ago
class Foo
include Cinch::Plugin
listen_to :connect, :method => :join_channel
def join_channel(m)
bot.join(config[:channel])
end
end
bot = Cinch::Bot.new do
configure do |c|
c.plugins.options[Foo][:channel] = "#some_channel"
end
end
And I hope that plugin was just for demonstrative purposes, as Cinch has built-in options for joining channels when connecting.
Thanks for the snippet.
Could you point me to an example / the doc where the auto join options are shown?
Thanks in advance. :)
Hi,
I know this is not a support forum but I either didn't check the docs correctly or the specific use case is missing.
I want to pass down plugin specific configuration to a plugin (e.g. via a Hash). How can I achieve this?
assuming my plugin is:
Whats the correct way to pass the
options
Hash to the plugin (and register it in the cinch bot?)Thanks in advance!