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.Commands;
using ImageSharp;
using NadekoBot.Attributes;
using NadekoBot.Extensions;
using NadekoBot.Services;
@ -10,7 +9,6 @@ using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using ImageSharp.Formats;
using Image = ImageSharp.Image;
namespace NadekoBot.Modules.Gambling

View File

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