Interface IGuildScheduledEvent
Represents a generic guild scheduled event.
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public interface IGuildScheduledEvent : IEntity<ulong>
Properties
| Improve this Doc View SourceChannelId
Gets the optional channel id where this event will be hosted.
Declaration
ulong? ChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
CoverImageId
Gets the banner asset id of the event.
Declaration
string CoverImageId { get; }
Property Value
Type | Description |
---|---|
String |
Creator
Gets the user who created the event.
Declaration
IUser Creator { get; }
Property Value
Type | Description |
---|---|
IUser |
Description
Gets the description of the event.
Declaration
string Description { get; }
Property Value
Type | Description |
---|---|
String |
Remarks
This field is null when the event doesn't have a discription.
EndTime
Gets the optional end time of the event.
Declaration
DateTimeOffset? EndTime { get; }
Property Value
Type | Description |
---|---|
Nullable<DateTimeOffset> |
EntityId
Gets the optional entity id of the event. The "entity" of the event can be a stage instance event as is seperate from ChannelId.
Declaration
ulong? EntityId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
Guild
Gets the guild this event is scheduled in.
Declaration
IGuild Guild { get; }
Property Value
Type | Description |
---|---|
IGuild |
Location
Gets the location of the event if the Type is external.
Declaration
string Location { get; }
Property Value
Type | Description |
---|---|
String |
Name
Gets the name of the event.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
String |
PrivacyLevel
Gets the privacy level of the event.
Declaration
GuildScheduledEventPrivacyLevel PrivacyLevel { get; }
Property Value
Type | Description |
---|---|
GuildScheduledEventPrivacyLevel |
StartTime
Gets the start time of the event.
Declaration
DateTimeOffset StartTime { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
Status
Gets the status of the event.
Declaration
GuildScheduledEventStatus Status { get; }
Property Value
Type | Description |
---|---|
GuildScheduledEventStatus |
Type
Gets the type of the event.
Declaration
GuildScheduledEventType Type { get; }
Property Value
Type | Description |
---|---|
GuildScheduledEventType |
UserCount
Gets the user count of the event.
Declaration
int? UserCount { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
Methods
| Improve this Doc View SourceDeleteAsync(RequestOptions)
Deletes the current event.
Declaration
Task DeleteAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous delete operation. |
EndAsync(RequestOptions)
Ends or canceles the event.
Declaration
Task EndAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous end operation. |
GetCoverImageUrl(ImageFormat, UInt16)
Gets this events banner image url.
Declaration
string GetCoverImageUrl(ImageFormat format = ImageFormat.Auto, ushort size = null)
Parameters
Type | Name | Description |
---|---|---|
ImageFormat | format | The format to return. |
UInt16 | size | The size of the image to return in. This can be any power of two between 16 and 2048. |
Returns
Type | Description |
---|---|
String | The cover images url. |
GetUsersAsync(RequestOptions)
Gets a collection of N users interested in the event.
Declaration
IAsyncEnumerable<IReadOnlyCollection<IUser>> GetUsersAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, Direction, Int32, RequestOptions)
Gets a collection of N users interested in the event.
Declaration
IAsyncEnumerable<IReadOnlyCollection<IUser>> GetUsersAsync(ulong fromUserId, Direction dir, int limit = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | fromUserId | The ID of the starting user to get the users from. |
Direction | dir | The direction of the users to be gotten from. |
Int32 | limit | The numbers of users to be gotten from. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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.
Declaration
Task ModifyAsync(Action<GuildScheduledEventsProperties> func, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GuildScheduledEventsProperties> | func | The delegate containing the properties to modify the event with. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous modification operation. |
StartAsync(RequestOptions)
Starts the event.
Declaration
Task StartAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous start operation. |