NadekoBot/NadekoBot.Modules.Utility/VerboseErrorCommands.cs

28 lines
912 B
C#
Raw Normal View History

using Discord.Commands;
using System.Threading.Tasks;
2017-07-17 19:42:36 +00:00
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Utility.Services;
namespace NadekoBot.Modules.Utility
{
public partial class Utility
{
[Group]
2017-07-17 19:42:36 +00:00
public class VerboseErrorCommands : NadekoSubmodule<VerboseErrorsService>
{
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
[RequireUserPermission(Discord.GuildPermission.ManageMessages)]
public async Task VerboseError()
{
2017-07-15 16:34:34 +00:00
var state = _service.ToggleVerboseErrors(Context.Guild.Id);
if (state)
await ReplyConfirmLocalized("verbose_errors_enabled").ConfigureAwait(false);
else
await ReplyConfirmLocalized("verbose_errors_disabled").ConfigureAwait(false);
}
}
}
}