I'm currently creating a discord bot. I know and can create both a Role and Voice channel however I'm trying to make the bot create the channel as private so only people from the role I just created (and admins) can connect to that server meaning it is a secure chat for the role. If anyone could give me a hand on how to do this is would be greatly appreciated! Here is the code I have so far:
public class GuildService
{
private Color[] colors = new Color[] {Color.Blue, Color.DarkBlue, Color.DarkerGrey, Color.DarkGreen, Color.DarkGrey, Color.DarkMagenta, Color.DarkOrange, Color.DarkPurple, Color.DarkRed, Color.DarkTeal, Color.Default, Color.Gold, Color.Green, Color.LighterGrey, Color.LightGrey,
Color.LightOrange, Color.Magenta, Color.Orange, Color.Purple, Color.Red, Color.Teal};
public async Task SetupGroup(SocketGuildUser user, string Ext)
{
Random ran = new Random();
ulong origin = (ulong)GuildPermission.Speak + (ulong)GuildPermission.SendTTSMessages + (ulong)GuildPermission.SendMessages + (ulong)GuildPermission.ReadMessages + (ulong)GuildPermission.EmbedLinks + (ulong)GuildPermission.Connect + (ulong)GuildPermission.AttachFiles + (ulong)GuildPermission.AddReactions;
GuildPermissions perms = new GuildPermissions(origin);
var guild = await user.Guild.CreateRoleAsync(Ext, perms, colors[ran.Next(colors.Length)], true);
var vChan = await user.Guild.CreateVoiceChannelAsync(Ext);
}
}
Cheers again in advance!