Top Level Namespace

Defined Under Namespace

Modules: Admin, Cinch, DB, Plugins, Zeta Classes: BlackListStruct, ConfigStruct, String

Constant Summary collapse

Bot =
Cinch::Bot.new do
  configure do |c|
    c.nick                      = Config.nickname
    c.nicks                     = Config.nicks.split(',')
    c.user                      = Config.username
    c.realname                  = Config.realname
    c.sasl.username             = Config.sasl_username
    c.sasl.password             = Config.sasl_password
    c.server                    = Config.server
    c.password                  = Config.password
    c.port                      = Config.port
    c.ssl.use                   = Config.ssl
    c.max_messages              = Config.max_messages
    c.messages_per_second       = Config.messages_per_second
    c.modes                     = Config.modes.split(',')
    c.channels                  = Config.channels.split(',')
    c.plugins.prefix            = /^#{Config.prefix}/
  end

  # Execute on confirmation of connection
  on :connect do
    # Gain operator privileges if oper username and password are set in config
    if Config.oper_username && Config.oper_password
      if !Config.oper_password.empty?
        @bot.oper(Config.oper_password, Config.oper_username)
      end
    end

  end

end
Config =

Initialize Config

ConfigStruct.new
Blacklist =
BlackListStruct.new([], [], [], [], [])

Instance Method Summary collapse

Instance Method Details

#clear_blacklistObject



20
21
22
23
24
25
26
27
# File 'lib/Zeta/blacklist.rb', line 20

def clear_blacklist()
  Blacklist.users = []
  Blacklist.plugins = []
  Blacklist.channels = []
  Blacklist.urls = []
  Blacklist.masks = []
  File.delete(File.join(Dir.home, '.zeta', 'cache', 'blacklist.rb'))
end

#load_locale(file) ⇒ Object



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/Zeta/locale.rb', line 1

def load_locale(file)
  Config.locale ||= 'en' # Default to english

  if File.exists?( File.join(Dir.home, '.zeta', 'locale', Config.locale, "#{file}.yml") )
    ## Overide included library if file exists
    YAML::load_file(
        File.join(Dir.home, '.zeta', 'locale', Config.locale, "#{file}.yml")
    )
  else
    YAML::load_file(
        File.join(File.dirname(__FILE__), 'locale', Config.locale, "#{file}.yml")
    )

  end


end

#save_blacklistObject

Methods



14
15
16
17
18
# File 'lib/Zeta/blacklist.rb', line 14

def save_blacklist()
  File.open(File.join(Dir.home, '.zeta', 'cache', 'blacklist.rb'), 'w+') do |file|
    Marshal.dump(Blacklist, file)
  end
end