2017-05-27 23:51:22 +00:00
|
|
|
|
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-05-27 23:51:22 +00:00
|
|
|
|
|
2017-06-15 18:20:34 +00:00
|
|
|
|
namespace NadekoBot.Modules.Permissions
|
2017-05-27 23:51:22 +00:00
|
|
|
|
{
|
|
|
|
|
public partial class Permissions
|
|
|
|
|
{
|
|
|
|
|
[Group]
|
|
|
|
|
public class ResetPermissionsCommands : NadekoSubmodule
|
|
|
|
|
{
|
2017-07-15 13:08:34 +00:00
|
|
|
|
private readonly ResetPermissionsService _service;
|
2017-05-27 23:51:22 +00:00
|
|
|
|
|
2017-07-15 13:08:34 +00:00
|
|
|
|
public ResetPermissionsCommands(ResetPermissionsService service)
|
2017-05-27 23:51:22 +00:00
|
|
|
|
{
|
|
|
|
|
_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);
|
2017-05-27 23:51:22 +00:00
|
|
|
|
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);
|
2017-05-27 23:51:22 +00:00
|
|
|
|
await ReplyConfirmLocalized("global_perms_reset").ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|