Method CreateScheduledEventAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
CreateScheduledEventAsync(string, DateTimeOffset, DateTimeOffset?, DiscordChannel, DiscordScheduledEventEntityMetadata, string, ScheduledEventEntityType, Optional<Stream>, DiscordScheduledEventRecurrenceRule?, string)
Creates a scheduled event.
public Task<DiscordScheduledEvent> CreateScheduledEventAsync(string name, DateTimeOffset scheduledStartTime, DateTimeOffset? scheduledEndTime = null, DiscordChannel channel = null, DiscordScheduledEventEntityMetadata metadata = null, string description = null, ScheduledEventEntityType type = ScheduledEventEntityType.StageInstance, Optional<Stream> coverImage = default, DiscordScheduledEventRecurrenceRule? recurrenceRule = null, string reason = null)
Parameters
namestringThe name.
scheduledStartTimeDateTimeOffsetThe scheduled start time.
scheduledEndTimeDateTimeOffset?The scheduled end time.
channelDiscordChannelThe channel.
metadataDiscordScheduledEventEntityMetadataThe metadata.
descriptionstringThe description.
typeScheduledEventEntityTypeThe type.
coverImageOptional<Stream>The cover image.
recurrenceRuleDiscordScheduledEventRecurrenceRuleThe recurrence rule.
reasonstringThe reason.
Returns
- Task<DiscordScheduledEvent>
A scheduled event.
Exceptions
- ValidationException
Thrown if the user gave an invalid input.
- NotFoundException
Thrown when the guild does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.