Add a refresh user command to the owner commands
This commit is contained in:
parent
0e1084ccad
commit
03343918b0
1 changed files with 16 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord;
|
using Discord;
|
||||||
using Discord.Commands;
|
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)]
|
[Command("error", RunMode = RunMode.Async)]
|
||||||
[Summary("Throw an error un purpose")]
|
[Summary("Throw an error un purpose")]
|
||||||
public async Task PurposefulError()
|
public async Task PurposefulError()
|
||||||
|
|
Loading…
Reference in a new issue