aboutsummaryrefslogtreecommitdiff
path: root/dinobot.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-04-21 06:23:47 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-04-21 06:23:47 -0700
commit607d7ae62d59bbc422da2211286fca96caa4f5e7 (patch)
tree4aecaa05b0b4a995e1fbb3f7d8e7af2059cff80d /dinobot.rb
parent349371e4c13e619b787fb4ab5a3dfcde95fd355e (diff)
downloaddinobot-607d7ae62d59bbc422da2211286fca96caa4f5e7.tar.gz
dinobot-607d7ae62d59bbc422da2211286fca96caa4f5e7.tar.xz
Add config system for non-module data.
Diffstat (limited to 'dinobot.rb')
-rw-r--r--dinobot.rb6
1 files changed, 3 insertions, 3 deletions
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)