View Source Nostrum.Api.ScheduledEvent (Nostrum v0.10.4)
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
@spec create( Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.AuditLogEntry.reason(), Nostrum.Api.options() ) :: {:ok, Nostrum.Struct.Guild.ScheduledEvent.t()} | Nostrum.Api.error()
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 forGUILD_ONLY:scheduled_start_time- required time for the event to start as aDateTimeor (ISO8601 timestamp)[DateTime.to_iso8601/3]:scheduled_end_time- optional time for the event to end as aDateTimeor (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 for1-STAGE_INSTANCE2-VOICE3-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.
@spec delete(Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.ScheduledEvent.id()) :: Nostrum.Api.error() | {:ok}
Delete a scheduled event for a guild.
@spec get(Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.ScheduledEvent.id()) :: Nostrum.Api.error() | {:ok, Nostrum.Struct.Guild.ScheduledEvent.t()}
Get a scheduled event for a guild.
@spec modify( Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.ScheduledEvent.id(), Nostrum.Struct.Guild.AuditLogEntry.reason(), Nostrum.Api.options() ) :: Nostrum.Api.error() | {:ok, Nostrum.Struct.Guild.ScheduledEvent.t()}
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-SCHEDULED2-ACTIVE3-COMPLETED4-CANCELLED
Copied from the official documentation:
- If updating entity_type to
EXTERNAL:channel_idis required and must be set to nullentity_metadatawith alocationfield must be providedscheduled_end_timemust be provided
@spec users( Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.ScheduledEvent.id(), Nostrum.Api.options() ) :: Nostrum.Api.error() | {:ok, [Nostrum.Struct.Guild.ScheduledEvent.User.t()]}
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 to100:with_member(boolean) whether to include the member object for each user, defaults tofalse:before(Nostrum.Snowflake.t/0) return only users before this user id, defaults tonil:after(Nostrum.Snowflake.t/0) return only users after this user id, defaults tonil