Nostrum.Api.ScheduledEvent (nostrum v0.11.0-dev)

View Source

Module for interacting with the Discord API's scheduled event endpoints.

See: https://discord.com/developers/docs/resources/guild-scheduled-event

Summary

Functions

Creates a new scheduled event for the guild.

Delete a scheduled event for a guild.

Get a scheduled event for a guild.

Modify a scheduled event for a guild.

Get a list of users who have subscribed to an event.

Functions

create(guild_id, reason \\ nil, options)

(since 1.x.x)

Creates a new scheduled event for the guild.

Options

  • :channel_id - (Nostrum.Snowflake.t/0) optional channel id for the event
  • :entity_metadata - (Nostrum.Struct.Guild.ScheduledEvent.EntityMetadata.t/0) metadata for the event
  • :name - (string) required name for the event
  • :privacy_level - (integer) at the time of writing, this must always be 2 for GUILD_ONLY
  • :scheduled_start_time - required time for the event to start as a DateTime or (ISO8601 timestamp)[DateTime.to_iso8601/3]
  • :scheduled_end_time - optional time for the event to end as a DateTime or (ISO8601 timestamp)[DateTime.to_iso8601/3]
  • :description - (string) optional description for the event
  • :entity_type - (integer) an integer representing the type of entity the event is for
    • 1 - STAGE_INSTANCE
    • 2 - VOICE
    • 3 - EXTERNAL

See the (official documentation)[https://discord.com/developers/docs/resources/guild-scheduled-event] for more information.

An optional reason can be specified for the audit log.

delete(guild_id, event_id)

(since 1.x.x)

Delete a scheduled event for a guild.

get(guild_id, event_id)

(since 1.x.x)

Get a scheduled event for a guild.

modify(guild_id, event_id, reason \\ nil, options)

(since 1.x.x)

Modify a scheduled event for a guild.

Options are the same as for create_guild_scheduled_event/2 except all fields are optional, with the additional optional integer field :status which can be one of:

  • 1 - SCHEDULED
  • 2 - ACTIVE
  • 3 - COMPLETED
  • 4 - CANCELLED

Copied from the official documentation:

  • If updating entity_type to EXTERNAL:
    • channel_id is required and must be set to null
    • entity_metadata with a location field must be provided
    • scheduled_end_time must be provided

users(guild_id, event_id, params \\ [])

(since 1.x.x)

Get a list of users who have subscribed to an event.

Options

All are optional, with their default values listed.

  • :limit (integer) maximum number of users to return, defaults to 100
  • :with_member (boolean) whether to include the member object for each user, defaults to false
  • :before (Nostrum.Snowflake.t/0) return only users before this user id, defaults to nil
  • :after (Nostrum.Snowflake.t/0) return only users after this user id, defaults to nil