cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

[example] join_part.rb uses foreign admin functions #223

Closed bazz1tv closed 8 years ago

bazz1tv commented 8 years ago

examples/basic/join_part.rb is probably from snap This code relies at least on an extension of Cinch::Bot such as the following:

class Bot < Cinch::Bot
  def admins
    @admins ||= $config["irc"]['admins']  # an array of strings
  end

  def admin?(user)
    user.refresh
    admins.include?(user.authname)
  end
end

I'm not sure if this is properly documented.

petertseng commented 8 years ago

Every function used in https://github.com/cinchrb/cinch/blob/master/examples/basic/join_part.rb seems to be defined - was there a specific one in mind? is_admin? is defined on line 14, $admin is defined on line 4, anything else that is missing?

bazz1tv commented 8 years ago

No, I got confused. Man, I'm a little embarrassed! Although I will say I like that the one snap has uses authname ^_^