Skip to content

Commit

Permalink
Add parent_id to the CreateGuildChannel method (#11)
Browse files Browse the repository at this point in the history
* ✨ add parent_id in CreateGuildChannel method
  • Loading branch information
emmanuelvlad authored Mar 22, 2020
1 parent 8c11690 commit 1c978d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Oxide.Ext.Discord/DiscordObjects/Guild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,18 @@ public void GetGuildChannels(DiscordClient client, Action<List<Channel>> callbac
client.REST.DoRequest($"/guilds/{id}/channels", RequestMethod.GET, null, callback);
}

public void CreateGuildChannel(DiscordClient client, Channel channel, Action<Channel> callback = null) => CreateGuildChannel(client, channel.name, channel.type, channel.bitrate, channel.user_limit, channel.permission_overwrites, callback);
public void CreateGuildChannel(DiscordClient client, Channel channel, Action<Channel> callback = null) => CreateGuildChannel(client, channel.name, channel.type, channel.bitrate, channel.user_limit, channel.permission_overwrites, channel.parent_id, callback);

public void CreateGuildChannel(DiscordClient client, string name, ChannelType? type, int? bitrate, int? userLimit, List<Overwrite> permissionOverwrites, Action<Channel> callback = null)
public void CreateGuildChannel(DiscordClient client, string name, ChannelType? type, int? bitrate, int? userLimit, List<Overwrite> permissionOverwrites, string parent_id, Action<Channel> callback = null)
{
var jsonObj = new Dictionary<string, object>()
{
{ "name", name },
{ "type", type },
{ "bitrate", bitrate },
{ "user_limit", userLimit },
{ "permission_overwrites", permissionOverwrites }
{ "permission_overwrites", permissionOverwrites },
{ "parent_id", parent_id }
};

client.REST.DoRequest($"/guilds/{id}/channels", RequestMethod.POST, jsonObj, callback);
Expand Down

0 comments on commit 1c978d7

Please sign in to comment.