Class: Discordrb::Events::ScheduledEventUserEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/discordrb/events/scheduled_events.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.



73
74
75
# File 'lib/discordrb/events/scheduled_events.rb', line 73

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.



66
67
68
# File 'lib/discordrb/events/scheduled_events.rb', line 66

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.



60
61
62
# File 'lib/discordrb/events/scheduled_events.rb', line 60

def server
  @bot.server(@server_id)
end