Module: IIRC::AcceptInvites

Defined in:
lib/iirc/modules/accept_invites.rb

Overview

Accept INVITEs to join a channel. By default, all invites are accepted.
To choose which ones to accept, define #accept_invite? on your object / class.

Instance Method Summary collapse

Instance Method Details

#accept_invite?(evt) ⇒ true

Decides whether to accept a given INVITE. By default, all invites are accepted.

Parameters:

  • evt (Event)

    the invite

Returns:

  • (true)

    if we should join the channel



10
11
12
# File 'lib/iirc/modules/accept_invites.rb', line 10

def accept_invite?(evt)
  true
end

#accept_invites(evt) ⇒ Object (private)



19
20
21
22
23
# File 'lib/iirc/modules/accept_invites.rb', line 19

def accept_invites(evt)
  if me === evt.target and accept_invite?(evt)
    join evt.args[1]
  end
end

#configure_accept_invitesObject (private)



15
16
17
# File 'lib/iirc/modules/accept_invites.rb', line 15

def configure_accept_invites
  on :invite, :accept_invites
end