Class DiscordScheduledEvent
Represents an scheduled event.
Namespace: DisCatSharp.Entities
Assembly: DisCatSharp.dll
Syntax
public class DiscordScheduledEvent : SnowflakeObject, IEquatable<DiscordScheduledEvent>
Properties
| Improve this Doc View SourceChannel
Gets the associated channel.
Declaration
public Task<DiscordChannel> Channel { get; }
Property Value
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordChannel> |
ChannelId
Gets id of the associated channel id.
Declaration
public ulong? ChannelId { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
CoverImageHash
Gets this event's cover hash, when applicable.
Declaration
public string CoverImageHash { get; }
Property Value
Type | Description |
---|---|
System.String |
CoverImageUrl
Gets this event's cover in url form.
Declaration
public string CoverImageUrl { get; }
Property Value
Type | Description |
---|---|
System.String |
Creator
Gets the user that created the scheduled event.
Declaration
public DiscordUser Creator { get; }
Property Value
Type | Description |
---|---|
DiscordUser |
CreatorId
Gets the ID of the user that created the scheduled event.
Declaration
public ulong CreatorId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
CreatorMember
Gets the member that created the scheduled event.
Declaration
public DiscordMember CreatorMember { get; }
Property Value
Type | Description |
---|---|
DiscordMember |
Description
Gets the description of the scheduled event.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
EntityId
Gets id of the entity.
Declaration
public ulong? EntityId { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
EntityMetadata
Gets metadata of the entity.
Declaration
public DiscordScheduledEventEntityMetadata EntityMetadata { get; }
Property Value
Type | Description |
---|---|
DiscordScheduledEventEntityMetadata |
EntityType
Gets the entity type.
Declaration
public ScheduledEventEntityType EntityType { get; }
Property Value
Type | Description |
---|---|
ScheduledEventEntityType |
Guild
Gets the guild to which this scheduled event belongs.
Declaration
public DiscordGuild Guild { get; }
Property Value
Type | Description |
---|---|
DiscordGuild |
GuildId
Gets the guild id of the associated scheduled event.
Declaration
public ulong GuildId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Name
Gets the name of the scheduled event.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
ScheduledEndTime
Gets the scheduled end time of the scheduled event.
Declaration
public DateTimeOffset? ScheduledEndTime { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTimeOffset> |
ScheduledStartTime
Gets the scheduled start time of the scheduled event.
Declaration
public DateTimeOffset? ScheduledStartTime { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTimeOffset> |
Status
Gets the status of the scheduled event.
Declaration
public ScheduledEventStatus Status { get; }
Property Value
Type | Description |
---|---|
ScheduledEventStatus |
UserCount
Gets the total number of users subscribed to the scheduled event.
Declaration
public int UserCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceCancelAsync(String)
Cancels the current scheduled event.
Declaration
public async Task<DiscordScheduledEvent> CancelAsync(string reason = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | The audit log reason. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordScheduledEvent> |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the ManageEvents permission. |
NotFoundException | Thrown when the event does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
DeleteAsync(String)
Deletes a scheduled event.
Declaration
public async Task DeleteAsync(string reason = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | The audit log reason. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the ManageEvents permission. |
NotFoundException | Thrown when the event does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
EndAsync(String)
Ends the current scheduled event.
Declaration
public async Task<DiscordScheduledEvent> EndAsync(string reason = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | The audit log reason. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordScheduledEvent> |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the ManageEvents permission. |
NotFoundException | Thrown when the event does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
Equals(DiscordScheduledEvent)
Checks whether this DiscordScheduledEvent is equal to another DiscordScheduledEvent.
Declaration
public bool Equals(DiscordScheduledEvent e)
Parameters
Type | Name | Description |
---|---|---|
DiscordScheduledEvent | e | DiscordScheduledEvent to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the DiscordScheduledEvent is equal to this DiscordScheduledEvent. |
Equals(Object)
Checks whether this DiscordScheduledEvent is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the object is equal to this DiscordScheduledEvent. |
Overrides
GetHashCode()
Gets the hash code for this DiscordScheduledEvent.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code for this DiscordScheduledEvent. |
Overrides
GetUsersAsync(Nullable<Int32>, Nullable<UInt64>, Nullable<UInt64>, Nullable<Boolean>)
Gets a list of users RSVP'd to the scheduled event.
Declaration
public async Task<IReadOnlyDictionary<ulong, DiscordScheduledEventUser>> GetUsersAsync(int? limit = null, ulong? before = null, ulong? after = null, bool? withMember = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Int32> | limit | The limit how many users to receive from the event. Defaults to 100. Max 100. |
System.Nullable<System.UInt64> | before | Get results of DiscordScheduledEventUser before the given snowflake. |
System.Nullable<System.UInt64> | after | Get results of DiscordScheduledEventUser after the given snowflake. |
System.Nullable<System.Boolean> | withMember | Whether to include guild member data. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<System.UInt64, DiscordScheduledEventUser>> |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the correct permissions. |
NotFoundException | Thrown when the event does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
ModifyAsync(Action<ScheduledEventEditModel>)
Modifies the current scheduled event.
Declaration
public async Task ModifyAsync(Action<ScheduledEventEditModel> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<ScheduledEventEditModel> | action | Action to perform on this thread |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the ManageEvents permission. |
NotFoundException | Thrown when the event does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
StartAsync(String)
Starts the current scheduled event.
Declaration
public async Task<DiscordScheduledEvent> StartAsync(string reason = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordScheduledEvent> |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the ManageEvents permission. |
NotFoundException | Thrown when the event does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
Operators
| Improve this Doc View SourceEquality(DiscordScheduledEvent, DiscordScheduledEvent)
Gets whether the two DiscordScheduledEvent objects are equal.
Declaration
public static bool operator ==(DiscordScheduledEvent e1, DiscordScheduledEvent e2)
Parameters
Type | Name | Description |
---|---|---|
DiscordScheduledEvent | e1 | First event to compare. |
DiscordScheduledEvent | e2 | Second event to compare. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the two events are equal. |
Inequality(DiscordScheduledEvent, DiscordScheduledEvent)
Gets whether the two DiscordScheduledEvent objects are not equal.
Declaration
public static bool operator !=(DiscordScheduledEvent e1, DiscordScheduledEvent e2)
Parameters
Type | Name | Description |
---|---|---|
DiscordScheduledEvent | e1 | First event to compare. |
DiscordScheduledEvent | e2 | Second event to compare. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the two events are not equal. |