class Irc::Bot::Auth::DefaultBotUserClass

This is the default BotUser: it’s used for all users which haven’t identified with the bot

Public Class Methods

new() click to toggle source

The default BotUser is named ‘everyone’

Calls superclass method Irc::Bot::Auth::BotUser::new
# File lib/rbot/botuser.rb, line 537
def initialize
  reset_login_by_mask
  reset_autologin
  super("everyone")
  @default_perm = PermissionSet.new
end

Public Instance Methods

autologin=(val) click to toggle source

This method returns without changing anything

# File lib/rbot/botuser.rb, line 559
def autologin=(val)
  debug "Tried to change the autologin for default bot user, ignoring"
  return
end
knows?(user) click to toggle source

default knows everybody

# File lib/rbot/botuser.rb, line 580
def knows?(user)
  return true if user.to_irc_user
end
login(user, password) click to toggle source

We always allow logging in as the default user

# File lib/rbot/botuser.rb, line 585
def login(user, password)
  return true
end
login_by_mask=(val) click to toggle source

This method returns without changing anything

# File lib/rbot/botuser.rb, line 546
def login_by_mask=(val)
  debug "Tried to change the login-by-mask for default bot user, ignoring"
  return @login_by_mask
end
permit?(cmd, chan=nil) click to toggle source

DefaultBotUser will check the default_perm after checking the global ones or on all channels if chan is nil

Calls superclass method Irc::Bot::Auth::BotUser#permit?
# File lib/rbot/botuser.rb, line 593
def permit?(cmd, chan=nil)
  allow = super(cmd, chan)
  if allow.nil? && chan.nil?
    allow = @default_perm.permit?(cmd)
  end
  return allow
end
reset_autologin() click to toggle source

The default botuser doesn’t allow autologin (meaningless)

# File lib/rbot/botuser.rb, line 566
def reset_autologin
  @autologin = false
end
reset_login_by_mask() click to toggle source

The default botuser allows logins by mask

# File lib/rbot/botuser.rb, line 553
def reset_login_by_mask
  @login_by_mask = true
end
set_default_permission(cmd, val) click to toggle source

Sets the default permission for the default user (i.e. the ones set by the BotModule writers) on all channels

# File lib/rbot/botuser.rb, line 573
def set_default_permission(cmd, val)
  @default_perm.set_permission(Command.new(cmd), val)
  debug "Default permissions now: #{@default_perm.pretty_inspect}"
end