Fixed code inconsistencies and adding support for logging to sentryio
This commit is contained in:
parent
2e083bc188
commit
9efac29956
18 changed files with 228 additions and 161 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Discord;
|
||||
using Discord.Commands;
|
||||
using Geekbot.net.Lib;
|
||||
|
@ -7,14 +8,28 @@ namespace Geekbot.net.Commands
|
|||
{
|
||||
public class Say : ModuleBase
|
||||
{
|
||||
private readonly IErrorHandler _errorHandler;
|
||||
|
||||
public Say(IErrorHandler errorHandler)
|
||||
{
|
||||
_errorHandler = errorHandler;
|
||||
}
|
||||
|
||||
[RequireUserPermission(GuildPermission.Administrator)]
|
||||
[Command("say", RunMode = RunMode.Async)]
|
||||
[Remarks(CommandCategories.Admin)]
|
||||
[Summary("Say Something.")]
|
||||
public async Task Echo([Remainder] [Summary("What?")] string echo)
|
||||
{
|
||||
await Context.Message.DeleteAsync();
|
||||
await ReplyAsync(echo);
|
||||
try
|
||||
{
|
||||
await Context.Message.DeleteAsync();
|
||||
await ReplyAsync(echo);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_errorHandler.HandleCommandException(e, Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue