Fixed a permission bug

This commit is contained in:
Kwoth 2017-03-21 08:46:13 +01:00
parent 49fbbbd325
commit e646debda5
2 changed files with 2 additions and 10 deletions

View File

@ -1,6 +1,5 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using ImageSharp;
using NadekoBot.Attributes; using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
@ -10,7 +9,6 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using ImageSharp.Formats;
using Image = ImageSharp.Image; using Image = ImageSharp.Image;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling

View File

@ -106,19 +106,13 @@ namespace NadekoBot.Modules.Permissions
switch (perm.PrimaryTarget) switch (perm.PrimaryTarget)
{ {
case PrimaryPermissionType.User: case PrimaryPermissionType.User:
if (guild == null) com += guild?.GetUser(perm.PrimaryTargetId).ToString() ?? $"<@{perm.PrimaryTargetId}>";
com += $"<@{perm.PrimaryTargetId}>";
else
com += guild.GetUser(perm.PrimaryTargetId).ToString() ?? $"<@{perm.PrimaryTargetId}>";
break; break;
case PrimaryPermissionType.Channel: case PrimaryPermissionType.Channel:
com += $"<#{perm.PrimaryTargetId}>"; com += $"<#{perm.PrimaryTargetId}>";
break; break;
case PrimaryPermissionType.Role: case PrimaryPermissionType.Role:
if(guild == null) com += guild?.GetRole(perm.PrimaryTargetId)?.ToString() ?? $"<@&{perm.PrimaryTargetId}>";
com += $"<@&{perm.PrimaryTargetId}>";
else
com += guild.GetRole(perm.PrimaryTargetId).ToString() ?? $"<@{perm.PrimaryTargetId}>";
break; break;
case PrimaryPermissionType.Server: case PrimaryPermissionType.Server:
break; break;