From 607d7ae62d59bbc422da2211286fca96caa4f5e7 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 21 Apr 2014 06:23:47 -0700 Subject: Add config system for non-module data. --- dinobot.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dinobot.rb') diff --git a/dinobot.rb b/dinobot.rb index a00517f..9b33894 100644 --- a/dinobot.rb +++ b/dinobot.rb @@ -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) -- cgit v1.2.3-70-g09d2