/// <summary> /// Create a new channel object for the guild. /// Requires the MANAGE_CHANNELS permission. /// See <a href="https://discord.com/developers/docs/resources/guild#create-guild-channel">Create Guild Channel</a> /// </summary> /// <param name="client">Client to use</param> /// <param name="guildId">Guild to create the channel in</param> /// <param name="channel">Channel to create</param> /// <param name="callback">Callback with created channel</param> /// <param name="error">Callback when an error occurs with error information</param> public static void CreateGuildChannel(DiscordClient client, Snowflake guildId, ChannelCreate channel, Action <DiscordChannel> callback = null, Action <RestError> error = null) { if (!guildId.IsValid()) { throw new InvalidSnowflakeException(nameof(guildId)); } client.Bot.Rest.DoRequest($"/guilds/{guildId}/channels", RequestMethod.POST, channel, callback, error); }
/// <summary> /// Create a new channel object for the guild. /// Requires the MANAGE_CHANNELS permission. /// See <a href="https://discord.com/developers/docs/resources/guild#create-guild-channel">Create Guild Channel</a> /// </summary> /// <param name="client">Client to use</param> /// <param name="guildId">Guild to create the channel in</param> /// <param name="channel">Channel to create</param> /// <param name="callback">Callback with created channel</param> /// <param name="error">Callback when an error occurs with error information</param> public static void CreateGuildChannel(DiscordClient client, Snowflake guildId, ChannelCreate channel, Action <DiscordChannel> callback = null, Action <RestError> error = null) { client.Bot.Rest.DoRequest($"/guilds/{guildId}/channels", RequestMethod.POST, channel, callback, error); }