Method CreateScheduledEventAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
CreateScheduledEventAsync(string, DateTimeOffset, string, Optional<Stream>, DiscordScheduledEventRecurrenceRule?, string)
Creates a scheduled event based on the channel type.
public Task<DiscordScheduledEvent> CreateScheduledEventAsync(string name, DateTimeOffset scheduledStartTime, string description = null, Optional<Stream> coverImage = default, DiscordScheduledEventRecurrenceRule? recurrenceRule = null, string reason = null)
Parameters
name
stringThe name.
scheduledStartTime
DateTimeOffsetThe scheduled start time.
description
stringThe description.
coverImage
Optional<Stream>The cover image.
recurrenceRule
DiscordScheduledEventRecurrenceRuleThe recurrence rule.
reason
stringThe reason.
Returns
- Task<DiscordScheduledEvent>
A scheduled event.
Exceptions
- ValidationException
Thrown if the user gave an invalid input.
- NotFoundException
Thrown when the resource does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.