Files
nadekobot/src/NadekoBot/Modules/Utility/VerboseErrorCommands.cs
2021-09-06 21:34:53 +02:00

29 lines
923 B
C#

using Discord;
using Discord.Commands;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Utility.Services;
using System.Threading.Tasks;
namespace NadekoBot.Modules.Utility
{
public partial class Utility
{
[Group]
public class VerboseErrorCommands : NadekoSubmodule<VerboseErrorsService>
{
[NadekoCommand, Aliases]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.ManageMessages)]
public async Task VerboseError(bool? newstate = null)
{
var state = _service.ToggleVerboseErrors(ctx.Guild.Id, newstate);
if (state)
await ReplyConfirmLocalizedAsync(strs.verbose_errors_enabled).ConfigureAwait(false);
else
await ReplyConfirmLocalizedAsync(strs.verbose_errors_disabled).ConfigureAwait(false);
}
}
}
}