/// <summary> /// Create a guild scheduled event in the guild. /// Returns a <see cref="GuildScheduledEvent">guild scheduled event</see> object on success. /// See <a href="https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event">Create Guild Scheduled Event</a> /// </summary> /// <param name="client">Client to use</param> /// <param name="guildId">Guild to create event in</param> /// <param name="create">Guild Scheduled Event to create</param> /// <param name="callback">Callback with the created scheduled events</param> /// <param name="error">Callback when an error occurs with error information</param> public static void Create(DiscordClient client, Snowflake guildId, ScheduledEventCreate create, Action <GuildScheduledEvent> callback = null, Action <RestError> error = null) { if (!guildId.IsValid()) { throw new InvalidSnowflakeException(nameof(guildId)); } client.Bot.Rest.DoRequest($"/guilds/{guildId}/scheduled-events", RequestMethod.POST, create, callback, error); }
/// <summary> /// Create a guild scheduled event in the guild. /// Returns a <see cref="GuildScheduledEvent">guild scheduled event</see> object on success. /// See <a href="https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event">Create Guild Scheduled Event</a> /// </summary> /// <param name="client">Client to use</param> /// <param name="guildId">Guild to create event in</param> /// <param name="create">Guild Scheduled Event to create</param> /// <param name="callback">Callback with the created scheduled events</param> /// <param name="error">Callback when an error occurs with error information</param> public static void Create(DiscordClient client, Snowflake guildId, ScheduledEventCreate create, Action <GuildScheduledEvent> callback = null, Action <RestError> error = null) { client.Bot.Rest.DoRequest($"/guilds/{guildId}/scheduled-events", RequestMethod.POST, create, callback, error); }