NadekoBot/NadekoBot.Core/Modules/Permissions/ResetPermissionsCommands.cs

40 lines
1.3 KiB
C#
Raw Normal View History

using Discord;
using Discord.Commands;
using System.Threading.Tasks;
2017-07-17 19:42:36 +00:00
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Permissions.Services;
2017-06-15 18:20:34 +00:00
namespace NadekoBot.Modules.Permissions
{
public partial class Permissions
{
[Group]
public class ResetPermissionsCommands : NadekoSubmodule
{
2017-07-15 13:08:34 +00:00
private readonly ResetPermissionsService _service;
2017-07-15 13:08:34 +00:00
public ResetPermissionsCommands(ResetPermissionsService service)
{
_service = service;
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
[RequireUserPermission(GuildPermission.Administrator)]
public async Task ResetPermissions()
{
2017-07-15 13:08:34 +00:00
await _service.ResetPermissions(Context.Guild.Id).ConfigureAwait(false);
await ReplyConfirmLocalized("perms_reset").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[OwnerOnly]
public async Task ResetGlobalPermissions()
{
2017-07-15 13:08:34 +00:00
await _service.ResetGlobalPermissions().ConfigureAwait(false);
await ReplyConfirmLocalized("global_perms_reset").ConfigureAwait(false);
}
}
}
}