Class: LibDiscord::GuildScheduledEvent

Inherits:
Resource
  • Object
show all
Defined in:
lib/lib_discord/guild_scheduled_event.rb

Overview

Guild Scheduled Event

Do not instantiate a GuildScheduledEvent directly. Instead request one from an instance of Client.

client = LibDiscord::Client.new("Bot auth.token")
g = client["guild_scheduled_event"]

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from LibDiscord::Resource

Instance Method Details

#create_guild_scheduled_event(guild_id:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



49
50
51
# File 'lib/lib_discord/guild_scheduled_event.rb', line 49

def create_guild_scheduled_event(guild_id:, json:)
  send_request(:post, "/guilds/#{guild_id}/scheduled-events", json:)
end

#delete_guild_scheduled_event(guild_id:, guild_scheduled_event_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



108
109
110
# File 'lib/lib_discord/guild_scheduled_event.rb', line 108

def delete_guild_scheduled_event(guild_id:, guild_scheduled_event_id:)
  send_request(:delete, "/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}")
end

#get_guild_scheduled_event(guild_id:, guild_scheduled_event_id:, params: {}) ⇒ Response

Parameters:

Returns:

Raises:

  • (TimeoutError)

    if the HTTP request times out

  • (ConstraintError)

    if params cannot be coerced into a valid query parameters string

See Also:



70
71
72
# File 'lib/lib_discord/guild_scheduled_event.rb', line 70

def get_guild_scheduled_event(guild_id:, guild_scheduled_event_id:, params: {})
  send_request(:get, "/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}", params:)
end

#get_guild_scheduled_event_users(guild_id:, guild_scheduled_event_id:, params: {}) ⇒ Response

Parameters:

Returns:

Raises:

  • (TimeoutError)

    if the HTTP request times out

  • (ConstraintError)

    if params cannot be coerced into a valid query parameters string

See Also:



129
130
131
# File 'lib/lib_discord/guild_scheduled_event.rb', line 129

def get_guild_scheduled_event_users(guild_id:, guild_scheduled_event_id:, params: {})
  send_request(:get, "/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}/users", params:)
end

#list_scheduled_events_for_guild(guild_id:, params: {}) ⇒ Response

Parameters:

Returns:

Raises:

  • (TimeoutError)

    if the HTTP request times out

  • (ConstraintError)

    if params cannot be coerced into a valid query parameters string

See Also:



32
33
34
# File 'lib/lib_discord/guild_scheduled_event.rb', line 32

def list_scheduled_events_for_guild(guild_id:, params: {})
  send_request(:get, "/guilds/#{guild_id}/scheduled-events", params:)
end

#modify_guild_scheduled_event(guild_id:, guild_scheduled_event_id:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



90
91
92
# File 'lib/lib_discord/guild_scheduled_event.rb', line 90

def modify_guild_scheduled_event(guild_id:, guild_scheduled_event_id:, json:)
  send_request(:patch, "/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}", json:)
end