mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
- Removed NadekoCommand and Aliases attribute from all commands
- All commands must be marked as partial - Added [Cmd] Attribute to all commands - Cmd Attribute comes from the source generator which adds [NadekoCommand] and [Aliases] Attribute to each command - Should be updated in the future probably to be more performant and maybe add extra data to the commands - Started reorganizing modules and submodules
This commit is contained in:
@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Permissions;
|
||||
public partial class Permissions
|
||||
{
|
||||
[Group]
|
||||
public class BlacklistCommands : NadekoSubmodule<BlacklistService>
|
||||
public partial class BlacklistCommands : NadekoSubmodule<BlacklistService>
|
||||
{
|
||||
private readonly DiscordSocketClient _client;
|
||||
|
||||
@@ -66,10 +66,9 @@ public partial class Permissions
|
||||
10);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public Task UserBlacklist(int page = 1)
|
||||
public partial Task UserBlacklist(int page = 1)
|
||||
{
|
||||
if (--page < 0)
|
||||
return Task.CompletedTask;
|
||||
@@ -77,10 +76,9 @@ public partial class Permissions
|
||||
return ListBlacklistInternal(GetText(strs.blacklisted_users), BlacklistType.User, page);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public Task ChannelBlacklist(int page = 1)
|
||||
public partial Task ChannelBlacklist(int page = 1)
|
||||
{
|
||||
if (--page < 0)
|
||||
return Task.CompletedTask;
|
||||
@@ -88,10 +86,9 @@ public partial class Permissions
|
||||
return ListBlacklistInternal(GetText(strs.blacklisted_channels), BlacklistType.Channel, page);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public Task ServerBlacklist(int page = 1)
|
||||
public partial Task ServerBlacklist(int page = 1)
|
||||
{
|
||||
if (--page < 0)
|
||||
return Task.CompletedTask;
|
||||
@@ -99,34 +96,29 @@ public partial class Permissions
|
||||
return ListBlacklistInternal(GetText(strs.blacklisted_servers), BlacklistType.Server, page);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public Task UserBlacklist(AddRemove action, ulong id)
|
||||
public partial Task UserBlacklist(AddRemove action, ulong id)
|
||||
=> Blacklist(action, id, BlacklistType.User);
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public Task UserBlacklist(AddRemove action, IUser usr)
|
||||
public partial Task UserBlacklist(AddRemove action, IUser usr)
|
||||
=> Blacklist(action, usr.Id, BlacklistType.User);
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public Task ChannelBlacklist(AddRemove action, ulong id)
|
||||
public partial Task ChannelBlacklist(AddRemove action, ulong id)
|
||||
=> Blacklist(action, id, BlacklistType.Channel);
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public Task ServerBlacklist(AddRemove action, ulong id)
|
||||
public partial Task ServerBlacklist(AddRemove action, ulong id)
|
||||
=> Blacklist(action, id, BlacklistType.Server);
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public Task ServerBlacklist(AddRemove action, IGuild guild)
|
||||
public partial Task ServerBlacklist(AddRemove action, IGuild guild)
|
||||
=> Blacklist(action, guild.Id, BlacklistType.Server);
|
||||
|
||||
private async Task Blacklist(AddRemove action, ulong id, BlacklistType type)
|
||||
|
@@ -10,7 +10,7 @@ namespace NadekoBot.Modules.Permissions;
|
||||
public partial class Permissions
|
||||
{
|
||||
[Group]
|
||||
public class CmdCdsCommands : NadekoSubmodule
|
||||
public partial class CmdCdsCommands : NadekoSubmodule
|
||||
{
|
||||
private ConcurrentDictionary<ulong, ConcurrentHashSet<CommandCooldown>> CommandCooldowns
|
||||
=> _service.CommandCooldowns;
|
||||
@@ -27,10 +27,9 @@ public partial class Permissions
|
||||
_db = db;
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task CmdCooldown(CommandOrCrInfo command, int secs)
|
||||
public async partial Task CmdCooldown(CommandOrCrInfo command, int secs)
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
if (secs is < 0 or > 3600)
|
||||
@@ -71,10 +70,9 @@ public partial class Permissions
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task AllCmdCooldowns()
|
||||
public async partial Task AllCmdCooldowns()
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
var localSet = CommandCooldowns.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<CommandCooldown>());
|
||||
|
@@ -9,27 +9,25 @@ namespace NadekoBot.Modules.Permissions;
|
||||
public partial class Permissions
|
||||
{
|
||||
[Group]
|
||||
public class FilterCommands : NadekoSubmodule<FilterService>
|
||||
public partial class FilterCommands : NadekoSubmodule<FilterService>
|
||||
{
|
||||
private readonly DbService _db;
|
||||
|
||||
public FilterCommands(DbService db)
|
||||
=> _db = db;
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async Task FwClear()
|
||||
public async partial Task FwClear()
|
||||
{
|
||||
_service.ClearFilteredWords(ctx.Guild.Id);
|
||||
await ReplyConfirmLocalizedAsync(strs.fw_cleared);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task SrvrFilterInv()
|
||||
public async partial Task SrvrFilterInv()
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
|
||||
@@ -53,10 +51,9 @@ public partial class Permissions
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task ChnlFilterInv()
|
||||
public async partial Task ChnlFilterInv()
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
|
||||
@@ -87,10 +84,9 @@ public partial class Permissions
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task SrvrFilterLin()
|
||||
public async partial Task SrvrFilterLin()
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
|
||||
@@ -114,10 +110,9 @@ public partial class Permissions
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task ChnlFilterLin()
|
||||
public async partial Task ChnlFilterLin()
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
|
||||
@@ -148,10 +143,9 @@ public partial class Permissions
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task SrvrFilterWords()
|
||||
public async partial Task SrvrFilterWords()
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
|
||||
@@ -175,10 +169,9 @@ public partial class Permissions
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task ChnlFilterWords()
|
||||
public async partial Task ChnlFilterWords()
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
|
||||
@@ -209,10 +202,9 @@ public partial class Permissions
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task FilterWord([Leftover] string word)
|
||||
public async partial Task FilterWord([Leftover] string word)
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
|
||||
@@ -251,10 +243,9 @@ public partial class Permissions
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task LstFilterWords(int page = 1)
|
||||
public async partial Task LstFilterWords(int page = 1)
|
||||
{
|
||||
page--;
|
||||
if (page < 0)
|
||||
|
@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Permissions;
|
||||
public partial class Permissions
|
||||
{
|
||||
[Group]
|
||||
public class GlobalPermissionCommands : NadekoSubmodule
|
||||
public partial class GlobalPermissionCommands : NadekoSubmodule
|
||||
{
|
||||
private GlobalPermissionService _service;
|
||||
private readonly DbService _db;
|
||||
@@ -18,10 +18,9 @@ public partial class Permissions
|
||||
_db = db;
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async Task GlobalPermList()
|
||||
public async partial Task GlobalPermList()
|
||||
{
|
||||
var blockedModule = _service.BlockedModules;
|
||||
var blockedCommands = _service.BlockedCommands;
|
||||
@@ -42,10 +41,9 @@ public partial class Permissions
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async Task GlobalModule(ModuleOrCrInfo module)
|
||||
public async partial Task GlobalModule(ModuleOrCrInfo module)
|
||||
{
|
||||
var moduleName = module.Name.ToLowerInvariant();
|
||||
|
||||
@@ -60,10 +58,9 @@ public partial class Permissions
|
||||
await ReplyConfirmLocalizedAsync(strs.gmod_remove(Format.Bold(module.Name)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async Task GlobalCommand(CommandOrCrInfo cmd)
|
||||
public async partial Task GlobalCommand(CommandOrCrInfo cmd)
|
||||
{
|
||||
var commandName = cmd.Name.ToLowerInvariant();
|
||||
var added = _service.ToggleCommand(commandName);
|
||||
|
@@ -17,10 +17,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
public Permissions(DbService db)
|
||||
=> _db = db;
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task Verbose(PermissionAction action = null)
|
||||
public async partial Task Verbose(PermissionAction action = null)
|
||||
{
|
||||
await using (var uow = _db.GetDbContext())
|
||||
{
|
||||
@@ -37,12 +36,11 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.verbose_false);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(0)]
|
||||
public async Task PermRole([Leftover] IRole role = null)
|
||||
public async partial Task PermRole([Leftover] IRole role = null)
|
||||
{
|
||||
if (role != null && role == role.Guild.EveryoneRole)
|
||||
return;
|
||||
@@ -69,12 +67,11 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.permrole_changed(Format.Bold(role.Name)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(1)]
|
||||
public async Task PermRole(Reset _)
|
||||
public async partial Task PermRole(Reset _)
|
||||
{
|
||||
await using (var uow = _db.GetDbContext())
|
||||
{
|
||||
@@ -87,10 +84,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.permrole_reset);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task ListPerms(int page = 1)
|
||||
public async partial Task ListPerms(int page = 1)
|
||||
{
|
||||
if (page < 1)
|
||||
return;
|
||||
@@ -121,10 +117,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ctx.Channel.SendMessageAsync(toSend);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task RemovePerm(int index)
|
||||
public async partial Task RemovePerm(int index)
|
||||
{
|
||||
index -= 1;
|
||||
if (index < 0)
|
||||
@@ -152,10 +147,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
}
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task MovePerm(int from, int to)
|
||||
public async partial Task MovePerm(int from, int to)
|
||||
{
|
||||
from -= 1;
|
||||
to -= 1;
|
||||
@@ -205,10 +199,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.perm_out_of_range);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task SrvrCmd(CommandOrCrInfo command, PermissionAction action)
|
||||
public async partial Task SrvrCmd(CommandOrCrInfo command, PermissionAction action)
|
||||
{
|
||||
await _service.AddPermissions(ctx.Guild.Id,
|
||||
new Permissionv2
|
||||
@@ -227,10 +220,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.sx_disable(Format.Code(command.Name), GetText(strs.of_command)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task SrvrMdl(ModuleOrCrInfo module, PermissionAction action)
|
||||
public async partial Task SrvrMdl(ModuleOrCrInfo module, PermissionAction action)
|
||||
{
|
||||
await _service.AddPermissions(ctx.Guild.Id,
|
||||
new Permissionv2
|
||||
@@ -248,10 +240,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.sx_disable(Format.Code(module.Name), GetText(strs.of_module)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task UsrCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] IGuildUser user)
|
||||
public async partial Task UsrCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] IGuildUser user)
|
||||
{
|
||||
await _service.AddPermissions(ctx.Guild.Id,
|
||||
new Permissionv2
|
||||
@@ -274,10 +265,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
Format.Code(user.ToString())));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task UsrMdl(ModuleOrCrInfo module, PermissionAction action, [Leftover] IGuildUser user)
|
||||
public async partial Task UsrMdl(ModuleOrCrInfo module, PermissionAction action, [Leftover] IGuildUser user)
|
||||
{
|
||||
await _service.AddPermissions(ctx.Guild.Id,
|
||||
new Permissionv2
|
||||
@@ -299,10 +289,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
Format.Code(user.ToString())));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task RoleCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] IRole role)
|
||||
public async partial Task RoleCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] IRole role)
|
||||
{
|
||||
if (role == role.Guild.EveryoneRole)
|
||||
return;
|
||||
@@ -328,10 +317,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
Format.Code(role.Name)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task RoleMdl(ModuleOrCrInfo module, PermissionAction action, [Leftover] IRole role)
|
||||
public async partial Task RoleMdl(ModuleOrCrInfo module, PermissionAction action, [Leftover] IRole role)
|
||||
{
|
||||
if (role == role.Guild.EveryoneRole)
|
||||
return;
|
||||
@@ -357,10 +345,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
Format.Code(role.Name)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task ChnlCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] ITextChannel chnl)
|
||||
public async partial Task ChnlCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] ITextChannel chnl)
|
||||
{
|
||||
await _service.AddPermissions(ctx.Guild.Id,
|
||||
new Permissionv2
|
||||
@@ -383,10 +370,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
Format.Code(chnl.Name)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task ChnlMdl(ModuleOrCrInfo module, PermissionAction action, [Leftover] ITextChannel chnl)
|
||||
public async partial Task ChnlMdl(ModuleOrCrInfo module, PermissionAction action, [Leftover] ITextChannel chnl)
|
||||
{
|
||||
await _service.AddPermissions(ctx.Guild.Id,
|
||||
new Permissionv2
|
||||
@@ -408,10 +394,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
Format.Code(chnl.Name)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task AllChnlMdls(PermissionAction action, [Leftover] ITextChannel chnl)
|
||||
public async partial Task AllChnlMdls(PermissionAction action, [Leftover] ITextChannel chnl)
|
||||
{
|
||||
await _service.AddPermissions(ctx.Guild.Id,
|
||||
new Permissionv2
|
||||
@@ -429,10 +414,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.acm_disable(Format.Code(chnl.Name)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task AllRoleMdls(PermissionAction action, [Leftover] IRole role)
|
||||
public async partial Task AllRoleMdls(PermissionAction action, [Leftover] IRole role)
|
||||
{
|
||||
if (role == role.Guild.EveryoneRole)
|
||||
return;
|
||||
@@ -453,10 +437,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.arm_disable(Format.Code(role.Name)));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task AllUsrMdls(PermissionAction action, [Leftover] IUser user)
|
||||
public async partial Task AllUsrMdls(PermissionAction action, [Leftover] IUser user)
|
||||
{
|
||||
await _service.AddPermissions(ctx.Guild.Id,
|
||||
new Permissionv2
|
||||
@@ -474,10 +457,9 @@ public partial class Permissions : NadekoModule<PermissionService>
|
||||
await ReplyConfirmLocalizedAsync(strs.aum_disable(Format.Code(user.ToString())));
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task AllSrvrMdls(PermissionAction action)
|
||||
public async partial Task AllSrvrMdls(PermissionAction action)
|
||||
{
|
||||
var newPerm = new Permissionv2
|
||||
{
|
||||
|
@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Permissions;
|
||||
public partial class Permissions
|
||||
{
|
||||
[Group]
|
||||
public class ResetPermissionsCommands : NadekoSubmodule
|
||||
public partial class ResetPermissionsCommands : NadekoSubmodule
|
||||
{
|
||||
private readonly GlobalPermissionService _gps;
|
||||
private readonly PermissionService _perms;
|
||||
@@ -17,20 +17,18 @@ public partial class Permissions
|
||||
_perms = perms;
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async Task ResetPerms()
|
||||
public async partial Task ResetPerms()
|
||||
{
|
||||
await _perms.Reset(ctx.Guild.Id);
|
||||
await ReplyConfirmLocalizedAsync(strs.perms_reset);
|
||||
}
|
||||
|
||||
[NadekoCommand]
|
||||
[Aliases]
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async Task ResetGlobalPerms()
|
||||
public async partial Task ResetGlobalPerms()
|
||||
{
|
||||
await _gps.Reset();
|
||||
await ReplyConfirmLocalizedAsync(strs.global_perms_reset);
|
||||
|
Reference in New Issue
Block a user