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
CoverImageId
Gets the banner asset id of the event.
string CoverImageId { get; }
Property Value
Creator
Gets the user who created the event.
IUser Creator { get; }
Property Value
Description
Gets the description of the event.
string Description { get; }
Property Value
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
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
Guild
Gets the guild this event is scheduled in.
IGuild Guild { get; }
Property Value
GuildId
Gets the id of the guild this event is scheduled in.
ulong GuildId { get; }
Property Value
Location
Gets the location of the event if the Type is external.
string Location { get; }
Property Value
Name
Gets the name of the event.
string Name { get; }
Property Value
PrivacyLevel
Gets the privacy level of the event.
GuildScheduledEventPrivacyLevel PrivacyLevel { get; }
Property Value
StartTime
Gets the start time of the event.
DateTimeOffset StartTime { get; }
Property Value
Status
Gets the status of the event.
GuildScheduledEventStatus Status { get; }
Property Value
Type
Gets the type of the event.
GuildScheduledEventType Type { get; }
Property Value
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
RequestOptionsThe 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
RequestOptionsThe 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
ImageFormatThe format to return.
size
ushortThe 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
RequestOptionsThe 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.
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
ulongThe ID of the starting user to get the users from.
dir
DirectionThe direction of the users to be gotten from.
limit
intThe numbers of users to be gotten from.
options
RequestOptionsThe 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!
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
RequestOptionsThe 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
RequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous start operation.