fixed other people being able to see newly created channels
This commit is contained in:
parent
1433ff0e03
commit
d9d368a7d1
@ -37,11 +37,16 @@ namespace NadekoBot.Commands {
|
||||
}
|
||||
var afterVch = e.After.VoiceChannel;
|
||||
if (afterVch != null) {
|
||||
var textChannel =
|
||||
e.Server.FindChannels(afterVch.Name + "-voice", ChannelType.Text).FirstOrDefault() ??
|
||||
(await e.Server.CreateChannel(afterVch.Name + "-voice", ChannelType.Text));
|
||||
if (textChannel == null)
|
||||
return;
|
||||
var textChannel = e.Server.FindChannels(
|
||||
$"{afterVch.Name}-voice",
|
||||
ChannelType.Text)
|
||||
.FirstOrDefault();
|
||||
if (textChannel == null) {
|
||||
textChannel = (await e.Server.CreateChannel(afterVch.Name + "-voice", ChannelType.Text));
|
||||
await textChannel.AddPermissionsRule(e.Server.EveryoneRole,
|
||||
new ChPermOverride(readMessages: PermValue.Deny,
|
||||
sendMessages: PermValue.Deny));
|
||||
}
|
||||
await textChannel.AddPermissionsRule(e.After,
|
||||
new ChPermOverride(readMessages: PermValue.Allow,
|
||||
sendMessages: PermValue.Allow));
|
||||
|
Loading…
Reference in New Issue
Block a user