run dotnet format
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -21,12 +21,12 @@ namespace Myriad.Extensions
|
||||
if (!cache.TryGetChannel(channelId, out var channel))
|
||||
// todo: handle channel not found better
|
||||
return PermissionSet.Dm;
|
||||
|
||||
|
||||
if (channel.GuildId == null)
|
||||
return PermissionSet.Dm;
|
||||
|
||||
var rootChannel = cache.GetRootChannel(channelId);
|
||||
|
||||
|
||||
var guild = cache.GetGuild(channel.GuildId.Value);
|
||||
|
||||
if (isWebhook)
|
||||
@@ -34,10 +34,10 @@ namespace Myriad.Extensions
|
||||
|
||||
return PermissionsFor(guild, rootChannel, userId, member);
|
||||
}
|
||||
|
||||
|
||||
public static PermissionSet EveryonePermissions(this Guild guild) =>
|
||||
guild.Roles.FirstOrDefault(r => r.Id == guild.Id)?.Permissions ?? PermissionSet.Dm;
|
||||
|
||||
|
||||
public static PermissionSet EveryonePermissions(this IDiscordCache cache, Channel channel)
|
||||
{
|
||||
if (channel.Type == Channel.ChannelType.Dm)
|
||||
@@ -62,7 +62,7 @@ namespace Myriad.Extensions
|
||||
{
|
||||
if (channel.Type == Channel.ChannelType.Dm)
|
||||
return PermissionSet.Dm;
|
||||
|
||||
|
||||
if (member == null)
|
||||
// this happens with system (Discord platform-owned) users - they're not actually in the guild, so there is no member object.
|
||||
return EveryonePermissions(guild);
|
||||
|
Reference in New Issue
Block a user