Fixed rotating status placeholders, permission mentioning

This commit is contained in:
Kwoth
2016-10-13 23:09:59 +02:00
parent 4235b897f1
commit 4c75c7e598
4 changed files with 19 additions and 12 deletions

View File

@@ -2,6 +2,7 @@
using Discord.Commands;
using Discord.WebSocket;
using NadekoBot.Attributes;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database;
using NadekoBot.Services.Database.Models;
@@ -47,10 +48,13 @@ namespace NadekoBot.Modules.Administration
if (!conf.RotatingStatusMessages.Any())
continue;
var status = conf.RotatingStatusMessages[index++].Status;
if (string.IsNullOrWhiteSpace(status))
continue;
PlayingPlaceholders.ForEach(e => status = status.Replace(e.Key, e.Value()));
await NadekoBot.Client
.GetCurrentUser()
.ModifyStatusAsync(mpp => mpp.Game = new Game(conf.RotatingStatusMessages[index++].Status))
.ModifyStatusAsync(mpp => mpp.Game = new Game(status))
.ConfigureAwait(false);
}
}

View File

@@ -136,7 +136,10 @@ namespace NadekoBot.Modules.Permissions
com += $"<#{perm.PrimaryTargetId}>";
break;
case PrimaryPermissionType.Role:
com += $"<@&{perm.PrimaryTargetId}>";
if(guild == null)
com += $"<@&{perm.PrimaryTargetId}>";
else
com += guild.GetRole(perm.PrimaryTargetId).ToString() ?? $"<@{perm.PrimaryTargetId}>";
break;
case PrimaryPermissionType.Server:
break;