Fixed code inconsistencies and adding support for logging to sentryio

This commit is contained in:
Runebaas 2017-10-26 00:55:04 +02:00
parent 2e083bc188
commit 9efac29956
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
18 changed files with 228 additions and 161 deletions

View file

@ -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);
}
}
}
}