diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-21 06:23:47 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-21 06:23:47 -0700 |
commit | 607d7ae62d59bbc422da2211286fca96caa4f5e7 (patch) | |
tree | 4aecaa05b0b4a995e1fbb3f7d8e7af2059cff80d /dinobot.rb | |
parent | 349371e4c13e619b787fb4ab5a3dfcde95fd355e (diff) | |
download | dinobot-607d7ae62d59bbc422da2211286fca96caa4f5e7.tar.gz dinobot-607d7ae62d59bbc422da2211286fca96caa4f5e7.tar.xz |
Add config system for non-module data.
Diffstat (limited to 'dinobot.rb')
-rw-r--r-- | dinobot.rb | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,6 @@ require 'timeout' +require_relative 'core/config' require_relative 'core/irc' require_relative 'core/logger' @@ -14,9 +15,8 @@ module Dinobot @nick = nick @pass = pass - @trigger = '!' - @irc = Dinobot::Core::IRC.new(@server, @port, @nick, @pass) + @config = Dinobot::Core::Config.instance @logger = Dinobot::Core::Logger.instance @modules = Hash.new @@ -115,7 +115,7 @@ module Dinobot if str =~ /(\S+) PRIVMSG (\S+) :(.*)/ user, channel, message = str.scan(/(\S+) PRIVMSG (\S+) :(.*)/).first - return unless message.sub!(/^#{Regexp.escape(@trigger)}/, '') + return unless message.sub!(/^#{Regexp.escape(@config.data[:trigger][:global])}/, '') if methods = exec_command(user, channel, message) ensure_valid_methods(methods) |