Class: OnyxCord::Events::ScheduledEventUserEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/onyxcord/events/scheduled_events/users.rb

Overview

Generic superclass for scheduled event user events.

Instance Attribute Summary

Attributes inherited from Event

#bot

Instance Method Summary collapse

Instance Method Details

#memberMember, User Also known as: user

Get the user that was added to or removed from the scheduled event.

Returns:

  • (Member, User)

    the server member that was added to or removed from the scheduled event, or a user if the member cannot be accessed by the bot.



41
42
43
# File 'lib/onyxcord/events/scheduled_events/users.rb', line 41

def member
  server.member(@user_id) || @bot.user(@user_id)
end

#scheduled_eventScheduledEvent

Get the scheduled event that the user was added to or removed from.

Returns:

  • (ScheduledEvent)

    the scheduled event that the user was actioned on.



34
35
36
# File 'lib/onyxcord/events/scheduled_events/users.rb', line 34

def scheduled_event
  server.scheduled_event(@scheduled_event_id)
end

#serverServer

Get the server the scheduled event in question is from.

Returns:

  • (Server)

    the server the scheduled event is associated with.



28
29
30
# File 'lib/onyxcord/events/scheduled_events/users.rb', line 28

def server
  @bot.server(@server_id)
end