Fix namehistory command
This commit is contained in:
parent
e8546f37f2
commit
26da438efe
1 changed files with 11 additions and 4 deletions
|
@ -33,11 +33,18 @@ namespace Geekbot.net.Commands.Admin
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var userRepo = _userRepository.Get(user.Id);
|
var userRepo = _userRepository.Get(user.Id);
|
||||||
|
if (userRepo != null && userRepo.UsedNames != null)
|
||||||
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
sb.AppendLine($":bust_in_silhouette: {user.Username} has been known as:");
|
sb.AppendLine($":bust_in_silhouette: {user.Username} has been known as:");
|
||||||
foreach (var name in userRepo.UsedNames) sb.AppendLine($"- `{name.Name}`");
|
foreach (var name in userRepo.UsedNames) sb.AppendLine($"- `{name.Name}`");
|
||||||
await ReplyAsync(sb.ToString());
|
await ReplyAsync(sb.ToString());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await ReplyAsync($"No name changes found for {user.Username}");
|
||||||
|
}
|
||||||
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
await _errorHandler.HandleCommandException(e, Context,
|
await _errorHandler.HandleCommandException(e, Context,
|
||||||
|
|
Loading…
Reference in a new issue