Class: Admin::Blacklister

Inherits:
Object
  • Object
show all
Includes:
Cinch::Plugin
Defined in:
lib/Zeta/admin/blacklister.rb

Instance Method Summary collapse

Methods included from Cinch::Plugin

#check?, #log2chan

Instance Method Details

#bl_channel(m, chan) ⇒ Object



26
27
28
29
30
31
# File 'lib/Zeta/admin/blacklister.rb', line 26

def bl_channel(m, chan)
  m.reply "#{chan} is already on BlackList" if Blacklist.channels.include? chan
  Blacklist.channels << chan
  save_blacklist()
  m.reply "#{chan} is now on the BlackList"
end

#bl_defaults(m) ⇒ Object



51
52
53
54
55
56
57
58
59
# File 'lib/Zeta/admin/blacklister.rb', line 51

def bl_defaults(m)
  clear_blacklist()
  Blacklist.urls = Config.options[:blacklist][:urls]
  Blacklist.users = Config.options[:blacklist][:users]
  Blacklist.masks = Config.options[:blacklist][:masks]
  Blacklist.channels = Config.options[:blacklist][:channels]
  save_blacklist()
  m.reply 'Default Blacklist Loaded'
end

#bl_mask(m, mask) ⇒ Object



40
41
42
43
44
45
# File 'lib/Zeta/admin/blacklister.rb', line 40

def bl_mask(m, mask)
  m.reply "#{mask} is already on BlackList" if Blacklist.masks.include? mask
  Blacklist.masks << url
  save_blacklist()
  m.reply "#{mask} is now on the BlackList"
end

#bl_plugin(m, plugin) ⇒ Object



47
48
49
# File 'lib/Zeta/admin/blacklister.rb', line 47

def bl_plugin(m, plugin)
  # TODO: This needs alot more work because i need to disable by channel
end

#bl_url(m, url) ⇒ Object



33
34
35
36
37
38
# File 'lib/Zeta/admin/blacklister.rb', line 33

def bl_url(m, url)
  m.reply "#{url} is already on BlackList" if Blacklist.channels.include? url
  Blacklist.urls << url
  save_blacklist()
  m.reply "#{url} is now on the BlackList"
end

#sync(m) ⇒ Object



61
62
63
64
# File 'lib/Zeta/admin/blacklister.rb', line 61

def sync(m)
  save_blacklist()
  m.action_reply 'Blacklist is now synced!'
end