Add a refresh user command to the owner commands

This commit is contained in:
runebaas 2019-05-16 22:01:35 +02:00
parent 0e1084ccad
commit 03343918b0
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
@ -78,6 +78,21 @@ namespace Geekbot.net.Commands.Admin.Owner
}
}
[Command("refreshuser", RunMode = RunMode.Async)]
[Summary("Refresh a user in the user cache")]
public async Task PopUserRepoCommand([Summary("@user")] IUser user)
{
try
{
await _userRepository.Update(user as SocketUser);
await ReplyAsync($"Refreshed: {user.Username}#{user.Discriminator}");
}
catch (Exception e)
{
await _errorHandler.HandleCommandException(e, Context);
}
}
[Command("error", RunMode = RunMode.Async)]
[Summary("Throw an error un purpose")]
public async Task PurposefulError()