Table of Contents

Interface IGuildScheduledEvent

Namespace
Discord
Assembly
Discord.Net.Core.dll

Represents a generic guild scheduled event.

public interface IGuildScheduledEvent : IEntity<ulong>
Inherited Members

Properties

ChannelId

Gets the optional channel id where this event will be hosted.

ulong? ChannelId { get; }

Property Value

ulong?

CoverImageId

Gets the banner asset id of the event.

string CoverImageId { get; }

Property Value

string

Creator

Gets the user who created the event.

IUser Creator { get; }

Property Value

IUser

Description

Gets the description of the event.

string Description { get; }

Property Value

string

Remarks

This field is null when the event doesn't have a description.

EndTime

Gets the optional end time of the event.

DateTimeOffset? EndTime { get; }

Property Value

DateTimeOffset?

EntityId

Gets the optional entity id of the event. The "entity" of the event can be a stage instance event as is separate from ChannelId.

ulong? EntityId { get; }

Property Value

ulong?

Guild

Gets the guild this event is scheduled in.

IGuild Guild { get; }

Property Value

IGuild

GuildId

Gets the id of the guild this event is scheduled in.

ulong GuildId { get; }

Property Value

ulong

Location

Gets the location of the event if the Type is external.

string Location { get; }

Property Value

string

Name

Gets the name of the event.

string Name { get; }

Property Value

string

PrivacyLevel

Gets the privacy level of the event.

GuildScheduledEventPrivacyLevel PrivacyLevel { get; }

Property Value

GuildScheduledEventPrivacyLevel

StartTime

Gets the start time of the event.

DateTimeOffset StartTime { get; }

Property Value

DateTimeOffset

Status

Gets the status of the event.

GuildScheduledEventStatus Status { get; }

Property Value

GuildScheduledEventStatus

Type

Gets the type of the event.

GuildScheduledEventType Type { get; }

Property Value

GuildScheduledEventType

UserCount

Gets the user count of the event.

int? UserCount { get; }

Property Value

int?

Methods

DeleteAsync(RequestOptions)

Deletes the current event.

Task DeleteAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous delete operation.

EndAsync(RequestOptions)

Ends or cancels the event.

Task EndAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous end operation.

GetCoverImageUrl(ImageFormat, ushort)

Gets this events banner image url.

string GetCoverImageUrl(ImageFormat format = ImageFormat.Auto, ushort size = 1024)

Parameters

format ImageFormat

The format to return.

size ushort

The size of the image to return in. This can be any power of two between 16 and 2048.

Returns

string

The cover images url.

GetUsersAsync(RequestOptions)

Gets a collection of N users interested in the event.

IAsyncEnumerable<IReadOnlyCollection<IUser>> GetUsersAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

IAsyncEnumerable<IReadOnlyCollection<IUser>>

Paged collection of users.

Remarks

important

The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual messages as a collection.

This method will attempt to fetch all users that are interested in the event. The library will attempt to split up the requests according to and MaxGuildEventUsersPerBatch. In other words, if there are 300 users, and the MaxGuildEventUsersPerBatch constant is 100, the request will be split into 3 individual requests; thus returning 3 individual asynchronous responses, hence the need of flattening.

GetUsersAsync(ulong, Direction, int, RequestOptions)

Gets a collection of N users interested in the event.

IAsyncEnumerable<IReadOnlyCollection<IUser>> GetUsersAsync(ulong fromUserId, Direction dir, int limit = 100, RequestOptions options = null)

Parameters

fromUserId ulong

The ID of the starting user to get the users from.

dir Direction

The direction of the users to be gotten from.

limit int

The numbers of users to be gotten from.

options RequestOptions

The options to be used when sending the request.

Returns

IAsyncEnumerable<IReadOnlyCollection<IUser>>

Paged collection of users.

Remarks

important

The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual users as a collection.

warning

Do not fetch too many users at once! This may cause unwanted preemptive rate limit or even actual rate limit, causing your bot to freeze!

This method will attempt to fetch the number of users specified under limit around the user fromUserId depending on the dir. The library will attempt to split up the requests according to your limit and MaxGuildEventUsersPerBatch. In other words, should the user request 500 users, and the MaxGuildEventUsersPerBatch constant is 100, the request will be split into 5 individual requests; thus returning 5 individual asynchronous responses, hence the need of flattening.

ModifyAsync(Action<GuildScheduledEventsProperties>, RequestOptions)

Modifies the guild event.

Task ModifyAsync(Action<GuildScheduledEventsProperties> func, RequestOptions options = null)

Parameters

func Action<GuildScheduledEventsProperties>

The delegate containing the properties to modify the event with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous modification operation.

StartAsync(RequestOptions)

Starts the event.

Task StartAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous start operation.