Fix namehistory command

This commit is contained in:
runebaas 2018-11-29 18:14:22 +01:00
parent e8546f37f2
commit 26da438efe
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -33,11 +33,18 @@ namespace Geekbot.net.Commands.Admin
try
{
var userRepo = _userRepository.Get(user.Id);
if (userRepo != null && userRepo.UsedNames != null)
{
var sb = new StringBuilder();
sb.AppendLine($":bust_in_silhouette: {user.Username} has been known as:");
foreach (var name in userRepo.UsedNames) sb.AppendLine($"- `{name.Name}`");
await ReplyAsync(sb.ToString());
}
else
{
await ReplyAsync($"No name changes found for {user.Username}");
}
}
catch (Exception e)
{
await _errorHandler.HandleCommandException(e, Context,