Created
October 22, 2014 00:30
-
-
Save jameswritescode/0964fb30b74d4abf7d2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $config = YAML.load_file('config.yml')[env] | |
| $bot = Cinch::Bot.new do | |
| configure do |c| | |
| c.nick = $config['bot']['nick'] | |
| c.user = $config['bot']['user'] | |
| c.realname = "#{$config['bot']['realname']} - #{`git log --pretty=format:'%h' -n 1`} - #{env}" | |
| c.server = $config['bot']['server'] | |
| c.channels = $config['bot']['channels'] | |
| c.password = $config['bot']['password'] | |
| c.messages_per_second = 1 | |
| if env == 'production' | |
| c.sasl.username = $config['bot']['sasl']['username'] | |
| c.sasl.password = $config['bot']['sasl']['password'] | |
| end | |
| c.plugins.plugins = [ | |
| Howell::Core::PluginLoader, | |
| Howell::Core::PluginWatcher, | |
| Howell::Core::PluginReload | |
| ] | |
| c.plugins.prefix = /^./ | |
| end | |
| if env == 'production' | |
| on :connect do |m| | |
| m.bot.irc.send $config['bot']['perform'] | |
| end | |
| end | |
| end | |
| Thread.new { $bot.start } | |
| Thread.new do | |
| set :port, 2772 | |
| $sinatra_pid = Process.pid | |
| Dir.glob('./plugins/requests/**/*.rb').each { |plugin| load(plugin) } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment