permissions done. now really 2 modules left, unless i forgot another one to make myself feel better

This commit is contained in:
Kwoth 2017-02-24 10:53:42 +01:00
parent 00629fa45f
commit 2ef3006ac0
7 changed files with 876 additions and 123 deletions

View File

@ -21,7 +21,7 @@ namespace NadekoBot.Modules.Permissions
} }
[Group] [Group]
public class BlacklistCommands : ModuleBase public class BlacklistCommands : NadekoSubmodule
{ {
public static ConcurrentHashSet<ulong> BlacklistedUsers { get; set; } public static ConcurrentHashSet<ulong> BlacklistedUsers { get; set; }
public static ConcurrentHashSet<ulong> BlacklistedGuilds { get; set; } public static ConcurrentHashSet<ulong> BlacklistedGuilds { get; set; }
@ -124,16 +124,14 @@ namespace NadekoBot.Modules.Permissions
break; break;
case BlacklistType.User: case BlacklistType.User:
break; break;
default:
break;
} }
} }
if(action == AddRemove.Add) if(action == AddRemove.Add)
await Context.Channel.SendConfirmAsync($"Blacklisted a `{type}` with id `{id}`").ConfigureAwait(false); await ReplyConfirmLocalized("blacklisted", Format.Code(type.ToString()), Format.Code(id.ToString())).ConfigureAwait(false);
else else
await Context.Channel.SendConfirmAsync($"Unblacklisted a `{type}` with id `{id}`").ConfigureAwait(false); await ReplyConfirmLocalized("unblacklisted", Format.Code(type.ToString()), Format.Code(id.ToString())).ConfigureAwait(false);
} }
} }
} }

View File

@ -21,15 +21,15 @@ namespace NadekoBot.Modules.Permissions
} }
[Group] [Group]
public class CmdCdsCommands : ModuleBase public class CmdCdsCommands : NadekoSubmodule
{ {
public static ConcurrentDictionary<ulong, ConcurrentHashSet<CommandCooldown>> commandCooldowns { get; } public static ConcurrentDictionary<ulong, ConcurrentHashSet<CommandCooldown>> CommandCooldowns { get; }
private static ConcurrentDictionary<ulong, ConcurrentHashSet<ActiveCooldown>> activeCooldowns { get; } = new ConcurrentDictionary<ulong, ConcurrentHashSet<ActiveCooldown>>(); private static ConcurrentDictionary<ulong, ConcurrentHashSet<ActiveCooldown>> activeCooldowns { get; } = new ConcurrentDictionary<ulong, ConcurrentHashSet<ActiveCooldown>>();
static CmdCdsCommands() static CmdCdsCommands()
{ {
var configs = NadekoBot.AllGuildConfigs; var configs = NadekoBot.AllGuildConfigs;
commandCooldowns = new ConcurrentDictionary<ulong, ConcurrentHashSet<CommandCooldown>>(configs.ToDictionary(k => k.GuildId, v => new ConcurrentHashSet<CommandCooldown>(v.CommandCooldowns))); CommandCooldowns = new ConcurrentDictionary<ulong, ConcurrentHashSet<CommandCooldown>>(configs.ToDictionary(k => k.GuildId, v => new ConcurrentHashSet<CommandCooldown>(v.CommandCooldowns)));
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
@ -38,14 +38,14 @@ namespace NadekoBot.Modules.Permissions
var channel = (ITextChannel)Context.Channel; var channel = (ITextChannel)Context.Channel;
if (secs < 0 || secs > 3600) if (secs < 0 || secs > 3600)
{ {
await channel.SendErrorAsync("Invalid second parameter. (Must be a number between 0 and 3600)").ConfigureAwait(false); await ReplyErrorLocalized("invalid_second_param_between", 0, 3600).ConfigureAwait(false);
return; return;
} }
using (var uow = DbHandler.UnitOfWork()) using (var uow = DbHandler.UnitOfWork())
{ {
var config = uow.GuildConfigs.For(channel.Guild.Id, set => set.Include(gc => gc.CommandCooldowns)); var config = uow.GuildConfigs.For(channel.Guild.Id, set => set.Include(gc => gc.CommandCooldowns));
var localSet = commandCooldowns.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<CommandCooldown>()); var localSet = CommandCooldowns.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<CommandCooldown>());
config.CommandCooldowns.RemoveWhere(cc => cc.CommandName == command.Aliases.First().ToLowerInvariant()); config.CommandCooldowns.RemoveWhere(cc => cc.CommandName == command.Aliases.First().ToLowerInvariant());
localSet.RemoveWhere(cc => cc.CommandName == command.Aliases.First().ToLowerInvariant()); localSet.RemoveWhere(cc => cc.CommandName == command.Aliases.First().ToLowerInvariant());
@ -65,13 +65,14 @@ namespace NadekoBot.Modules.Permissions
{ {
var activeCds = activeCooldowns.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<ActiveCooldown>()); var activeCds = activeCooldowns.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<ActiveCooldown>());
activeCds.RemoveWhere(ac => ac.Command == command.Aliases.First().ToLowerInvariant()); activeCds.RemoveWhere(ac => ac.Command == command.Aliases.First().ToLowerInvariant());
await channel.SendConfirmAsync($"🚮 Command **{command.Aliases.First()}** has no coooldown now and all existing cooldowns have been cleared.") await ReplyConfirmLocalized("cmdcd_cleared",
.ConfigureAwait(false); Format.Bold(command.Aliases.First())).ConfigureAwait(false);
} }
else else
{ {
await channel.SendConfirmAsync($"✅ Command **{command.Aliases.First()}** now has a **{secs} {"seconds".SnPl(secs)}** cooldown.") await ReplyConfirmLocalized("cmdcd_add",
.ConfigureAwait(false); Format.Bold(command.Aliases.First()),
Format.Bold(secs.ToString())).ConfigureAwait(false);
} }
} }
@ -80,19 +81,19 @@ namespace NadekoBot.Modules.Permissions
public async Task AllCmdCooldowns() public async Task AllCmdCooldowns()
{ {
var channel = (ITextChannel)Context.Channel; var channel = (ITextChannel)Context.Channel;
var localSet = commandCooldowns.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<CommandCooldown>()); var localSet = CommandCooldowns.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<CommandCooldown>());
if (!localSet.Any()) if (!localSet.Any())
await channel.SendConfirmAsync(" `No command cooldowns set.`").ConfigureAwait(false); await ReplyConfirmLocalized("cmdcd_none").ConfigureAwait(false);
else else
await channel.SendTableAsync("", localSet.Select(c => c.CommandName + ": " + c.Seconds + " secs"), s => $"{s,-30}", 2).ConfigureAwait(false); await channel.SendTableAsync("", localSet.Select(c => c.CommandName + ": " + c.Seconds + GetText("sec")), s => $"{s,-30}", 2).ConfigureAwait(false);
} }
public static bool HasCooldown(CommandInfo cmd, IGuild guild, IUser user) public static bool HasCooldown(CommandInfo cmd, IGuild guild, IUser user)
{ {
if (guild == null) if (guild == null)
return false; return false;
var cmdcds = CmdCdsCommands.commandCooldowns.GetOrAdd(guild.Id, new ConcurrentHashSet<CommandCooldown>()); var cmdcds = CmdCdsCommands.CommandCooldowns.GetOrAdd(guild.Id, new ConcurrentHashSet<CommandCooldown>());
CommandCooldown cdRule; CommandCooldown cdRule;
if ((cdRule = cmdcds.FirstOrDefault(cc => cc.CommandName == cmd.Aliases.First().ToLowerInvariant())) != null) if ((cdRule = cmdcds.FirstOrDefault(cc => cc.CommandName == cmd.Aliases.First().ToLowerInvariant())) != null)
{ {

View File

@ -17,7 +17,7 @@ namespace NadekoBot.Modules.Permissions
public partial class Permissions public partial class Permissions
{ {
[Group] [Group]
public class CommandCostCommands : ModuleBase public class CommandCostCommands : NadekoSubmodule
{ {
private static readonly ConcurrentDictionary<string, int> _commandCosts = new ConcurrentDictionary<string, int>(); private static readonly ConcurrentDictionary<string, int> _commandCosts = new ConcurrentDictionary<string, int>();
public static IReadOnlyDictionary<string, int> CommandCosts => _commandCosts; public static IReadOnlyDictionary<string, int> CommandCosts => _commandCosts;
@ -29,29 +29,29 @@ namespace NadekoBot.Modules.Permissions
// x => x.Cost)); // x => x.Cost));
} }
[NadekoCommand, Usage, Description, Aliases] //[NadekoCommand, Usage, Description, Aliases]
public async Task CmdCosts(int page = 1) //public async Task CmdCosts(int page = 1)
{ //{
var prices = _commandCosts.ToList(); // var prices = _commandCosts.ToList();
if (!prices.Any()) // if (!prices.Any())
{ // {
await Context.Channel.SendConfirmAsync("No costs set.").ConfigureAwait(false); // await Context.Channel.SendConfirmAsync(GetText("no_costs")).ConfigureAwait(false);
return; // return;
} // }
await Context.Channel.SendPaginatedConfirmAsync(page, (curPage) => { // await Context.Channel.SendPaginatedConfirmAsync(page, (curPage) => {
var embed = new EmbedBuilder().WithOkColor() // var embed = new EmbedBuilder().WithOkColor()
.WithTitle("Command Costs"); // .WithTitle(GetText("command_costs"));
var current = prices.Skip((curPage - 1) * 9) // var current = prices.Skip((curPage - 1) * 9)
.Take(9); // .Take(9);
foreach (var price in current) // foreach (var price in current)
{ // {
embed.AddField(efb => efb.WithName(price.Key).WithValue(price.Value.ToString()).WithIsInline(true)); // embed.AddField(efb => efb.WithName(price.Key).WithValue(price.Value.ToString()).WithIsInline(true));
} // }
return embed; // return embed;
}, prices.Count / 9).ConfigureAwait(false); // }, prices.Count / 9).ConfigureAwait(false);
} //}
//[NadekoCommand, Usage, Description, Aliases] //[NadekoCommand, Usage, Description, Aliases]
//public async Task CommandCost(int cost, CommandInfo cmd) //public async Task CommandCost(int cost, CommandInfo cmd)

View File

@ -13,13 +13,13 @@ namespace NadekoBot.Modules.Permissions
public partial class Permissions public partial class Permissions
{ {
[Group] [Group]
public class FilterCommands : ModuleBase public class FilterCommands : NadekoSubmodule
{ {
public static ConcurrentHashSet<ulong> InviteFilteringChannels { get; } public static ConcurrentHashSet<ulong> InviteFilteringChannels { get; }
public static ConcurrentHashSet<ulong> InviteFilteringServers { get; } public static ConcurrentHashSet<ulong> InviteFilteringServers { get; }
//serverid, filteredwords //serverid, filteredwords
private static ConcurrentDictionary<ulong, ConcurrentHashSet<string>> ServerFilteredWords { get; } private static ConcurrentDictionary<ulong, ConcurrentHashSet<string>> serverFilteredWords { get; }
public static ConcurrentHashSet<ulong> WordFilteringChannels { get; } public static ConcurrentHashSet<ulong> WordFilteringChannels { get; }
public static ConcurrentHashSet<ulong> WordFilteringServers { get; } public static ConcurrentHashSet<ulong> WordFilteringServers { get; }
@ -28,7 +28,7 @@ namespace NadekoBot.Modules.Permissions
{ {
ConcurrentHashSet<string> words = new ConcurrentHashSet<string>(); ConcurrentHashSet<string> words = new ConcurrentHashSet<string>();
if(WordFilteringChannels.Contains(channelId)) if(WordFilteringChannels.Contains(channelId))
ServerFilteredWords.TryGetValue(guildId, out words); serverFilteredWords.TryGetValue(guildId, out words);
return words; return words;
} }
@ -36,7 +36,7 @@ namespace NadekoBot.Modules.Permissions
{ {
var words = new ConcurrentHashSet<string>(); var words = new ConcurrentHashSet<string>();
if(WordFilteringServers.Contains(guildId)) if(WordFilteringServers.Contains(guildId))
ServerFilteredWords.TryGetValue(guildId, out words); serverFilteredWords.TryGetValue(guildId, out words);
return words; return words;
} }
@ -49,7 +49,7 @@ namespace NadekoBot.Modules.Permissions
var dict = guildConfigs.ToDictionary(gc => gc.GuildId, gc => new ConcurrentHashSet<string>(gc.FilteredWords.Select(fw => fw.Word))); var dict = guildConfigs.ToDictionary(gc => gc.GuildId, gc => new ConcurrentHashSet<string>(gc.FilteredWords.Select(fw => fw.Word)));
ServerFilteredWords = new ConcurrentDictionary<ulong, ConcurrentHashSet<string>>(dict); serverFilteredWords = new ConcurrentDictionary<ulong, ConcurrentHashSet<string>>(dict);
var serverFiltering = guildConfigs.Where(gc => gc.FilterWords); var serverFiltering = guildConfigs.Where(gc => gc.FilterWords);
WordFilteringServers = new ConcurrentHashSet<ulong>(serverFiltering.Select(gc => gc.GuildId)); WordFilteringServers = new ConcurrentHashSet<ulong>(serverFiltering.Select(gc => gc.GuildId));
@ -74,12 +74,12 @@ namespace NadekoBot.Modules.Permissions
if (enabled) if (enabled)
{ {
InviteFilteringServers.Add(channel.Guild.Id); InviteFilteringServers.Add(channel.Guild.Id);
await channel.SendConfirmAsync("Invite filtering enabled on this server.").ConfigureAwait(false); await ReplyConfirmLocalized("invite_filter_server_on").ConfigureAwait(false);
} }
else else
{ {
InviteFilteringServers.TryRemove(channel.Guild.Id); InviteFilteringServers.TryRemove(channel.Guild.Id);
await channel.SendConfirmAsync("Invite filtering disabled on this server.").ConfigureAwait(false); await ReplyConfirmLocalized("invite_filter_server_off").ConfigureAwait(false);
} }
} }
@ -107,12 +107,11 @@ namespace NadekoBot.Modules.Permissions
if (removed == 0) if (removed == 0)
{ {
InviteFilteringChannels.Add(channel.Id); InviteFilteringChannels.Add(channel.Id);
await channel.SendConfirmAsync("Invite filtering enabled on this channel.").ConfigureAwait(false); await ReplyConfirmLocalized("invite_filter_channel_on").ConfigureAwait(false);
} }
else else
{ {
InviteFilteringChannels.TryRemove(channel.Id); await ReplyConfirmLocalized("invite_filter_channel_off").ConfigureAwait(false);
await channel.SendConfirmAsync("Invite filtering disabled on this channel.").ConfigureAwait(false);
} }
} }
@ -133,12 +132,12 @@ namespace NadekoBot.Modules.Permissions
if (enabled) if (enabled)
{ {
WordFilteringServers.Add(channel.Guild.Id); WordFilteringServers.Add(channel.Guild.Id);
await channel.SendConfirmAsync("Word filtering enabled on this server.").ConfigureAwait(false); await ReplyConfirmLocalized("word_filter_server_on").ConfigureAwait(false);
} }
else else
{ {
WordFilteringServers.TryRemove(channel.Guild.Id); WordFilteringServers.TryRemove(channel.Guild.Id);
await channel.SendConfirmAsync("Word filtering disabled on this server.").ConfigureAwait(false); await ReplyConfirmLocalized("word_filter_server_off").ConfigureAwait(false);
} }
} }
@ -166,12 +165,12 @@ namespace NadekoBot.Modules.Permissions
if (removed == 0) if (removed == 0)
{ {
WordFilteringChannels.Add(channel.Id); WordFilteringChannels.Add(channel.Id);
await channel.SendConfirmAsync("Word filtering enabled on this channel.").ConfigureAwait(false); await ReplyConfirmLocalized("word_filter_channel_on").ConfigureAwait(false);
} }
else else
{ {
WordFilteringChannels.TryRemove(channel.Id); WordFilteringChannels.TryRemove(channel.Id);
await channel.SendConfirmAsync("Word filtering disabled on this channel.").ConfigureAwait(false); await ReplyConfirmLocalized("word_filter_channel_off").ConfigureAwait(false);
} }
} }
@ -199,19 +198,17 @@ namespace NadekoBot.Modules.Permissions
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
var filteredWords = ServerFilteredWords.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<string>()); var filteredWords = serverFilteredWords.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<string>());
if (removed == 0) if (removed == 0)
{ {
filteredWords.Add(word); filteredWords.Add(word);
await channel.SendConfirmAsync($"Word `{word}` successfully added to the list of filtered words.") await ReplyConfirmLocalized("filter_word_add", Format.Code(word)).ConfigureAwait(false);
.ConfigureAwait(false);
} }
else else
{ {
filteredWords.TryRemove(word); filteredWords.TryRemove(word);
await channel.SendConfirmAsync($"Word `{word}` removed from the list of filtered words.") await ReplyConfirmLocalized("filter_word_remove", Format.Code(word)).ConfigureAwait(false);
.ConfigureAwait(false);
} }
} }
@ -222,9 +219,9 @@ namespace NadekoBot.Modules.Permissions
var channel = (ITextChannel)Context.Channel; var channel = (ITextChannel)Context.Channel;
ConcurrentHashSet<string> filteredWords; ConcurrentHashSet<string> filteredWords;
ServerFilteredWords.TryGetValue(channel.Guild.Id, out filteredWords); serverFilteredWords.TryGetValue(channel.Guild.Id, out filteredWords);
await channel.SendConfirmAsync($"List of filtered words", string.Join("\n", filteredWords)) await channel.SendConfirmAsync(GetText("filter_word_list"), string.Join("\n", filteredWords))
.ConfigureAwait(false); .ConfigureAwait(false);
} }
} }

View File

@ -29,7 +29,7 @@ namespace NadekoBot.Modules.Permissions
static Permissions() static Permissions()
{ {
var _log = LogManager.GetCurrentClassLogger(); var log = LogManager.GetCurrentClassLogger();
var sw = Stopwatch.StartNew(); var sw = Stopwatch.StartNew();
using (var uow = DbHandler.UnitOfWork()) using (var uow = DbHandler.UnitOfWork())
@ -46,7 +46,7 @@ namespace NadekoBot.Modules.Permissions
} }
sw.Stop(); sw.Stop();
_log.Debug($"Loaded in {sw.Elapsed.TotalSeconds:F2}s"); log.Debug($"Loaded in {sw.Elapsed.TotalSeconds:F2}s");
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -65,8 +65,14 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.Verbose = config.VerbosePermissions; return old; }); }, (id, old) => { old.Verbose = config.VerbosePermissions; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
if (action.Value)
await Context.Channel.SendConfirmAsync(" I will " + (action.Value ? "now" : "no longer") + " show permission warnings.").ConfigureAwait(false); {
await ReplyConfirmLocalized("verbose_true").ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("verbose_false").ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -81,10 +87,9 @@ namespace NadekoBot.Modules.Permissions
var config = uow.GuildConfigs.For(Context.Guild.Id, set => set); var config = uow.GuildConfigs.For(Context.Guild.Id, set => set);
if (role == null) if (role == null)
{ {
await Context.Channel.SendConfirmAsync($" Current permission role is **{config.PermissionRole}**.").ConfigureAwait(false); await ReplyConfirmLocalized("permrole", Format.Bold(config.PermissionRole)).ConfigureAwait(false);
return; return;
} }
else {
config.PermissionRole = role.Name.Trim(); config.PermissionRole = role.Name.Trim();
Cache.AddOrUpdate(Context.Guild.Id, new PermissionCache() Cache.AddOrUpdate(Context.Guild.Id, new PermissionCache()
{ {
@ -94,9 +99,8 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.PermRole = role.Name.Trim(); return old; }); }, (id, old) => { old.PermRole = role.Name.Trim(); return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
}
await Context.Channel.SendConfirmAsync($"Users now require **{role.Name}** role in order to edit permissions.").ConfigureAwait(false); await ReplyConfirmLocalized("permrole_changed", Format.Bold(role.Name)).ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -105,12 +109,18 @@ namespace NadekoBot.Modules.Permissions
{ {
if (page < 1 || page > 4) if (page < 1 || page > 4)
return; return;
string toSend = ""; string toSend;
using (var uow = DbHandler.UnitOfWork()) using (var uow = DbHandler.UnitOfWork())
{ {
var perms = uow.GuildConfigs.PermissionsFor(Context.Guild.Id).RootPermission; var perms = uow.GuildConfigs.PermissionsFor(Context.Guild.Id).RootPermission;
var i = 1 + 20 * (page - 1); var i = 1 + 20 * (page - 1);
toSend = Format.Code($"📄 Permissions page {page}") + "\n\n" + String.Join("\n", perms.AsEnumerable().Skip((page - 1) * 20).Take(20).Select(p => $"`{(i++)}.` {(p.Next == null ? Format.Bold(p.GetCommand((SocketGuild)Context.Guild) + " [uneditable]") : (p.GetCommand((SocketGuild)Context.Guild)))}")); toSend = Format.Bold(GetText("page", page)) + "\n\n" + string.Join("\n",
perms.AsEnumerable()
.Skip((page - 1) * 20)
.Take(20)
.Select(
p =>
$"`{(i++)}.` {(p.Next == null ? Format.Bold(p.GetCommand((SocketGuild) Context.Guild) + $" [{GetText("uneditable")}]") : (p.GetCommand((SocketGuild) Context.Guild)))}"));
} }
await Context.Channel.SendMessageAsync(toSend).ConfigureAwait(false); await Context.Channel.SendMessageAsync(toSend).ConfigureAwait(false);
@ -132,7 +142,7 @@ namespace NadekoBot.Modules.Permissions
{ {
return; return;
} }
else if (index == 0) if (index == 0)
{ {
p = perms; p = perms;
config.RootPermission = perms.Next; config.RootPermission = perms.Next;
@ -155,12 +165,13 @@ namespace NadekoBot.Modules.Permissions
uow2._context.Remove<Permission>(p); uow2._context.Remove<Permission>(p);
uow2._context.SaveChanges(); uow2._context.SaveChanges();
} }
await ReplyConfirmLocalized("removed",
await Context.Channel.SendConfirmAsync($"✅ {Context.User.Mention} removed permission **{p.GetCommand((SocketGuild)Context.Guild)}** from position #{index + 1}.").ConfigureAwait(false); index+1,
Format.Code(p.GetCommand((SocketGuild)Context.Guild))).ConfigureAwait(false);
} }
catch (ArgumentOutOfRangeException) catch (IndexOutOfRangeException)
{ {
await Context.Channel.SendErrorAsync("❗️`No command on that index found.`").ConfigureAwait(false); await ReplyErrorLocalized("perm_out_of_range").ConfigureAwait(false);
} }
} }
@ -180,7 +191,6 @@ namespace NadekoBot.Modules.Permissions
{ {
var config = uow.GuildConfigs.PermissionsFor(Context.Guild.Id); var config = uow.GuildConfigs.PermissionsFor(Context.Guild.Id);
var perms = config.RootPermission; var perms = config.RootPermission;
var root = perms;
var index = 0; var index = 0;
var fromFound = false; var fromFound = false;
var toFound = false; var toFound = false;
@ -207,13 +217,13 @@ namespace NadekoBot.Modules.Permissions
{ {
if (!fromFound) if (!fromFound)
{ {
await Context.Channel.SendErrorAsync($"Can't find permission at index `#{++from}`").ConfigureAwait(false); await ReplyErrorLocalized("not_found", ++from).ConfigureAwait(false);
return; return;
} }
if (!toFound) if (!toFound)
{ {
await Context.Channel.SendErrorAsync($"Can't find permission at index `#{++to}`").ConfigureAwait(false); await ReplyErrorLocalized("not_found", ++to).ConfigureAwait(false);
return; return;
} }
} }
@ -230,7 +240,6 @@ namespace NadekoBot.Modules.Permissions
next.Previous = pre; next.Previous = pre;
if (from == 0) if (from == 0)
{ {
root = next;
} }
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
//Inserting //Inserting
@ -263,14 +272,18 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"`Moved permission:` \"{fromPerm.GetCommand((SocketGuild)Context.Guild)}\" `from #{++from} to #{++to}.`").ConfigureAwait(false); await ReplyConfirmLocalized("moved_permission",
Format.Code(fromPerm.GetCommand((SocketGuild) Context.Guild)),
++from,
++to)
.ConfigureAwait(false);
return; return;
} }
catch (Exception e) when (e is ArgumentOutOfRangeException || e is IndexOutOfRangeException) catch (Exception e) when (e is ArgumentOutOfRangeException || e is IndexOutOfRangeException)
{ {
} }
} }
await Context.Channel.SendErrorAsync("`Invalid index(es) specified.`").ConfigureAwait(false); await ReplyErrorLocalized("perm_out_of_range").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -297,7 +310,19 @@ namespace NadekoBot.Modules.Permissions
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `{command.Aliases.First()}` command on this server.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("sx_enable",
Format.Code(command.Aliases.First()),
GetText("of_command")).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("sx_disable",
Format.Code(command.Aliases.First()),
GetText("of_command")).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -323,7 +348,19 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of **`{module.Name}`** module on this server.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("sx_enable",
Format.Code(module.Name),
GetText("of_module")).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("sx_disable",
Format.Code(module.Name),
GetText("of_module")).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -349,7 +386,21 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `{command.Aliases.First()}` command for `{user}` user.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("ux_enable",
Format.Code(command.Aliases.First()),
GetText("of_command"),
Format.Code(user.ToString())).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("ux_disable",
Format.Code(command.Aliases.First()),
GetText("of_command"),
Format.Code(user.ToString())).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -375,7 +426,21 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `{module.Name}` module for `{user}` user.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("ux_enable",
Format.Code(module.Name),
GetText("of_module"),
Format.Code(user.ToString())).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("ux_disable",
Format.Code(module.Name),
GetText("of_module"),
Format.Code(user.ToString())).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -404,7 +469,21 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `{command.Aliases.First()}` command for `{role}` role.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("rx_enable",
Format.Code(command.Aliases.First()),
GetText("of_command"),
Format.Code(role.Name)).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("rx_disable",
Format.Code(command.Aliases.First()),
GetText("of_command"),
Format.Code(role.Name)).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -433,14 +512,27 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `{module.Name}` module for `{role}` role.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("rx_enable",
Format.Code(module.Name),
GetText("of_module"),
Format.Code(role.Name)).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("rx_disable",
Format.Code(module.Name),
GetText("of_module"),
Format.Code(role.Name)).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
public async Task ChnlCmd(CommandInfo command, PermissionAction action, [Remainder] ITextChannel chnl) public async Task ChnlCmd(CommandInfo command, PermissionAction action, [Remainder] ITextChannel chnl)
{
try
{ {
using (var uow = DbHandler.UnitOfWork()) using (var uow = DbHandler.UnitOfWork())
{ {
@ -461,11 +553,21 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
if (action.Value)
{
await ReplyConfirmLocalized("cx_enable",
Format.Code(command.Aliases.First()),
GetText("of_command"),
Format.Code(chnl.Name)).ConfigureAwait(false);
} }
catch (Exception ex) { else
_log.Error(ex); {
await ReplyConfirmLocalized("cx_disable",
Format.Code(command.Aliases.First()),
GetText("of_command"),
Format.Code(chnl.Name)).ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `{command.Aliases.First()}` command for `{chnl}` channel.").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -491,7 +593,21 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `{module.Name}` module for `{chnl}` channel.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("cx_enable",
Format.Code(module.Name),
GetText("of_module"),
Format.Code(chnl.Name)).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("cx_disable",
Format.Code(module.Name),
GetText("of_module"),
Format.Code(chnl.Name)).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -517,7 +633,17 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `ALL MODULES` for `{chnl}` channel.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("acm_enable",
Format.Code(chnl.Name)).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("acm_disable",
Format.Code(chnl.Name)).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -546,7 +672,17 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `ALL MODULES` for `{role}` role.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("arm_enable",
Format.Code(role.Name)).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("arm_disable",
Format.Code(role.Name)).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -572,7 +708,17 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `ALL MODULES` for `{user}` user.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("aum_enable",
Format.Code(user.ToString())).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("aum_disable",
Format.Code(user.ToString())).ConfigureAwait(false);
}
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -609,7 +755,15 @@ namespace NadekoBot.Modules.Permissions
}, (id, old) => { old.RootPermission = config.RootPermission; return old; }); }, (id, old) => { old.RootPermission = config.RootPermission; return old; });
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await Context.Channel.SendConfirmAsync($"{(action.Value ? " Allowed" : "🆗 Denied")} usage of `ALL MODULES` on this server.").ConfigureAwait(false);
if (action.Value)
{
await ReplyConfirmLocalized("asm_enable").ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalized("asm_disable").ConfigureAwait(false);
}
} }
} }
} }

View File

@ -3425,6 +3425,456 @@ namespace NadekoBot.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Disabled usage of ALL MODULES on {0} channel..
/// </summary>
public static string permissions_acm_disable {
get {
return ResourceManager.GetString("permissions_acm_disable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabled usage of ALL MODULES on {0} channel..
/// </summary>
public static string permissions_acm_enable {
get {
return ResourceManager.GetString("permissions_acm_enable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Allowed.
/// </summary>
public static string permissions_allowed {
get {
return ResourceManager.GetString("permissions_allowed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled usage of ALL MODULES for {0} role..
/// </summary>
public static string permissions_arm_disable {
get {
return ResourceManager.GetString("permissions_arm_disable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabled usage of ALL MODULES for {0} role..
/// </summary>
public static string permissions_arm_enable {
get {
return ResourceManager.GetString("permissions_arm_enable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled usage of ALL MODULES on this server..
/// </summary>
public static string permissions_asm_disable {
get {
return ResourceManager.GetString("permissions_asm_disable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabled usage of ALL MODULES on this server..
/// </summary>
public static string permissions_asm_enable {
get {
return ResourceManager.GetString("permissions_asm_enable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled usage of ALL MODULES for {0} user..
/// </summary>
public static string permissions_aum_disable {
get {
return ResourceManager.GetString("permissions_aum_disable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabled usage of ALL MODULES for {0} user..
/// </summary>
public static string permissions_aum_enable {
get {
return ResourceManager.GetString("permissions_aum_enable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Blacklisted {0} with ID {1}.
/// </summary>
public static string permissions_blacklisted {
get {
return ResourceManager.GetString("permissions_blacklisted", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Command {0} now has a {1}s cooldown..
/// </summary>
public static string permissions_cmdcd_add {
get {
return ResourceManager.GetString("permissions_cmdcd_add", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Command {0} has no coooldown now and all existing cooldowns have been cleared..
/// </summary>
public static string permissions_cmdcd_cleared {
get {
return ResourceManager.GetString("permissions_cmdcd_cleared", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No command cooldowns set..
/// </summary>
public static string permissions_cmdcd_none {
get {
return ResourceManager.GetString("permissions_cmdcd_none", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Command Costs.
/// </summary>
public static string permissions_command_costs {
get {
return ResourceManager.GetString("permissions_command_costs", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled usage of {0} {1} on {2} channel..
/// </summary>
public static string permissions_cx_disable {
get {
return ResourceManager.GetString("permissions_cx_disable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabled usage of {0} {1} on {2} channel..
/// </summary>
public static string permissions_cx_enable {
get {
return ResourceManager.GetString("permissions_cx_enable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Denied.
/// </summary>
public static string permissions_denied {
get {
return ResourceManager.GetString("permissions_denied", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Added word {0} to the list of filtered words..
/// </summary>
public static string permissions_filter_word_add {
get {
return ResourceManager.GetString("permissions_filter_word_add", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to List Of Filtered Words.
/// </summary>
public static string permissions_filter_word_list {
get {
return ResourceManager.GetString("permissions_filter_word_list", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Removed word {0} from the list of filtered words..
/// </summary>
public static string permissions_filter_word_remove {
get {
return ResourceManager.GetString("permissions_filter_word_remove", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invalid second parameter.(Must be a number between {0} and {1}).
/// </summary>
public static string permissions_invalid_second_param_between {
get {
return ResourceManager.GetString("permissions_invalid_second_param_between", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invite filtering disabled on this channel..
/// </summary>
public static string permissions_invite_filter_channel_off {
get {
return ResourceManager.GetString("permissions_invite_filter_channel_off", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invite filtering enabled on this channel..
/// </summary>
public static string permissions_invite_filter_channel_on {
get {
return ResourceManager.GetString("permissions_invite_filter_channel_on", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invite filtering disabled on this server..
/// </summary>
public static string permissions_invite_filter_server_off {
get {
return ResourceManager.GetString("permissions_invite_filter_server_off", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invite filtering enabled on this server..
/// </summary>
public static string permissions_invite_filter_server_on {
get {
return ResourceManager.GetString("permissions_invite_filter_server_on", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Moved permission {0} from #{1} to #{2}.
/// </summary>
public static string permissions_moved_permission {
get {
return ResourceManager.GetString("permissions_moved_permission", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No costs set..
/// </summary>
public static string permissions_no_costs {
get {
return ResourceManager.GetString("permissions_no_costs", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Can&apos;t find permission at index #{0}.
/// </summary>
public static string permissions_not_found {
get {
return ResourceManager.GetString("permissions_not_found", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to command.
/// </summary>
public static string permissions_of_command {
get {
return ResourceManager.GetString("permissions_of_command", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to module.
/// </summary>
public static string permissions_of_module {
get {
return ResourceManager.GetString("permissions_of_module", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Permissions page {0}.
/// </summary>
public static string permissions_page {
get {
return ResourceManager.GetString("permissions_page", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No permission found on that index..
/// </summary>
public static string permissions_perm_out_of_range {
get {
return ResourceManager.GetString("permissions_perm_out_of_range", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Current permissions role is {0}..
/// </summary>
public static string permissions_permrole {
get {
return ResourceManager.GetString("permissions_permrole", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Users now require {0} role in order to edit permissions..
/// </summary>
public static string permissions_permrole_changed {
get {
return ResourceManager.GetString("permissions_permrole_changed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to removed permission #{0} - {1}.
/// </summary>
public static string permissions_removed {
get {
return ResourceManager.GetString("permissions_removed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled usage of {0} {1} for {2} role..
/// </summary>
public static string permissions_rx_disable {
get {
return ResourceManager.GetString("permissions_rx_disable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabled usage of {0} {1} for {2} role..
/// </summary>
public static string permissions_rx_enable {
get {
return ResourceManager.GetString("permissions_rx_enable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to sec..
/// </summary>
public static string permissions_sec {
get {
return ResourceManager.GetString("permissions_sec", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled usage of {0} {1} on this server..
/// </summary>
public static string permissions_sx_disable {
get {
return ResourceManager.GetString("permissions_sx_disable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabled usage of {0} {1} on this server..
/// </summary>
public static string permissions_sx_enable {
get {
return ResourceManager.GetString("permissions_sx_enable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unblacklisted {0} with ID {1}.
/// </summary>
public static string permissions_unblacklisted {
get {
return ResourceManager.GetString("permissions_unblacklisted", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to uneditable.
/// </summary>
public static string permissions_uneditable {
get {
return ResourceManager.GetString("permissions_uneditable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled usage of {0} {1} for {2} user..
/// </summary>
public static string permissions_ux_disable {
get {
return ResourceManager.GetString("permissions_ux_disable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabled usage of {0} {1} for {2} user..
/// </summary>
public static string permissions_ux_enable {
get {
return ResourceManager.GetString("permissions_ux_enable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to I will no longer show permission warnings..
/// </summary>
public static string permissions_verbose_false {
get {
return ResourceManager.GetString("permissions_verbose_false", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to I will now show permission warnings..
/// </summary>
public static string permissions_verbose_true {
get {
return ResourceManager.GetString("permissions_verbose_true", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Word filtering disabled on this channel..
/// </summary>
public static string permissions_word_filter_channel_off {
get {
return ResourceManager.GetString("permissions_word_filter_channel_off", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Word filtering enabled on this channel..
/// </summary>
public static string permissions_word_filter_channel_on {
get {
return ResourceManager.GetString("permissions_word_filter_channel_on", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Word filtering disabled on this server..
/// </summary>
public static string permissions_word_filter_server_off {
get {
return ResourceManager.GetString("permissions_word_filter_server_off", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Word filtering enabled on this server..
/// </summary>
public static string permissions_word_filter_server_on {
get {
return ResourceManager.GetString("permissions_word_filter_server_on", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to {0} has already fainted.. /// Looks up a localized string similar to {0} has already fainted..
/// </summary> /// </summary>

View File

@ -1332,6 +1332,159 @@ Don't forget to leave your discord name or id in the message.
<data name="games_vs" xml:space="preserve"> <data name="games_vs" xml:space="preserve">
<value>{0} vs {1}</value> <value>{0} vs {1}</value>
</data> </data>
<data name="permissions_acm_disable" xml:space="preserve">
<value>Disabled usage of ALL MODULES on {0} channel.</value>
</data>
<data name="permissions_acm_enable" xml:space="preserve">
<value>Enabled usage of ALL MODULES on {0} channel.</value>
</data>
<data name="permissions_allowed" xml:space="preserve">
<value>Allowed</value>
</data>
<data name="permissions_arm_disable" xml:space="preserve">
<value>Disabled usage of ALL MODULES for {0} role.</value>
</data>
<data name="permissions_arm_enable" xml:space="preserve">
<value>Enabled usage of ALL MODULES for {0} role.</value>
</data>
<data name="permissions_asm_disable" xml:space="preserve">
<value>Disabled usage of ALL MODULES on this server.</value>
</data>
<data name="permissions_asm_enable" xml:space="preserve">
<value>Enabled usage of ALL MODULES on this server.</value>
</data>
<data name="permissions_aum_disable" xml:space="preserve">
<value>Disabled usage of ALL MODULES for {0} user.</value>
</data>
<data name="permissions_aum_enable" xml:space="preserve">
<value>Enabled usage of ALL MODULES for {0} user.</value>
</data>
<data name="permissions_blacklisted" xml:space="preserve">
<value>Blacklisted {0} with ID {1}</value>
</data>
<data name="permissions_cmdcd_add" xml:space="preserve">
<value>Command {0} now has a {1}s cooldown.</value>
</data>
<data name="permissions_cmdcd_cleared" xml:space="preserve">
<value>Command {0} has no coooldown now and all existing cooldowns have been cleared.</value>
</data>
<data name="permissions_cmdcd_none" xml:space="preserve">
<value>No command cooldowns set.</value>
</data>
<data name="permissions_command_costs" xml:space="preserve">
<value>Command Costs</value>
</data>
<data name="permissions_cx_disable" xml:space="preserve">
<value>Disabled usage of {0} {1} on {2} channel.</value>
</data>
<data name="permissions_cx_enable" xml:space="preserve">
<value>Enabled usage of {0} {1} on {2} channel.</value>
</data>
<data name="permissions_denied" xml:space="preserve">
<value>Denied</value>
</data>
<data name="permissions_filter_word_add" xml:space="preserve">
<value>Added word {0} to the list of filtered words.</value>
</data>
<data name="permissions_filter_word_list" xml:space="preserve">
<value>List Of Filtered Words</value>
</data>
<data name="permissions_filter_word_remove" xml:space="preserve">
<value>Removed word {0} from the list of filtered words.</value>
</data>
<data name="permissions_invalid_second_param_between" xml:space="preserve">
<value>Invalid second parameter.(Must be a number between {0} and {1})</value>
</data>
<data name="permissions_invite_filter_channel_off" xml:space="preserve">
<value>Invite filtering disabled on this channel.</value>
</data>
<data name="permissions_invite_filter_channel_on" xml:space="preserve">
<value>Invite filtering enabled on this channel.</value>
</data>
<data name="permissions_invite_filter_server_off" xml:space="preserve">
<value>Invite filtering disabled on this server.</value>
</data>
<data name="permissions_invite_filter_server_on" xml:space="preserve">
<value>Invite filtering enabled on this server.</value>
</data>
<data name="permissions_moved_permission" xml:space="preserve">
<value>Moved permission {0} from #{1} to #{2}</value>
</data>
<data name="permissions_not_found" xml:space="preserve">
<value>Can't find permission at index #{0}</value>
</data>
<data name="permissions_no_costs" xml:space="preserve">
<value>No costs set.</value>
</data>
<data name="permissions_of_command" xml:space="preserve">
<value>command</value>
<comment>Gen (of command)</comment>
</data>
<data name="permissions_of_module" xml:space="preserve">
<value>module</value>
<comment>Gen. (of module)</comment>
</data>
<data name="permissions_page" xml:space="preserve">
<value>Permissions page {0}</value>
</data>
<data name="permissions_permrole" xml:space="preserve">
<value>Current permissions role is {0}.</value>
</data>
<data name="permissions_permrole_changed" xml:space="preserve">
<value>Users now require {0} role in order to edit permissions.</value>
</data>
<data name="permissions_perm_out_of_range" xml:space="preserve">
<value>No permission found on that index.</value>
</data>
<data name="permissions_removed" xml:space="preserve">
<value>removed permission #{0} - {1}</value>
</data>
<data name="permissions_rx_disable" xml:space="preserve">
<value>Disabled usage of {0} {1} for {2} role.</value>
</data>
<data name="permissions_rx_enable" xml:space="preserve">
<value>Enabled usage of {0} {1} for {2} role.</value>
</data>
<data name="permissions_sec" xml:space="preserve">
<value>sec.</value>
<comment>Short of seconds.</comment>
</data>
<data name="permissions_sx_disable" xml:space="preserve">
<value>Disabled usage of {0} {1} on this server.</value>
</data>
<data name="permissions_sx_enable" xml:space="preserve">
<value>Enabled usage of {0} {1} on this server.</value>
</data>
<data name="permissions_unblacklisted" xml:space="preserve">
<value>Unblacklisted {0} with ID {1}</value>
</data>
<data name="permissions_uneditable" xml:space="preserve">
<value>uneditable</value>
</data>
<data name="permissions_ux_disable" xml:space="preserve">
<value>Disabled usage of {0} {1} for {2} user.</value>
</data>
<data name="permissions_ux_enable" xml:space="preserve">
<value>Enabled usage of {0} {1} for {2} user.</value>
</data>
<data name="permissions_verbose_false" xml:space="preserve">
<value>I will no longer show permission warnings.</value>
</data>
<data name="permissions_verbose_true" xml:space="preserve">
<value>I will now show permission warnings.</value>
</data>
<data name="permissions_word_filter_channel_off" xml:space="preserve">
<value>Word filtering disabled on this channel.</value>
</data>
<data name="permissions_word_filter_channel_on" xml:space="preserve">
<value>Word filtering enabled on this channel.</value>
</data>
<data name="permissions_word_filter_server_off" xml:space="preserve">
<value>Word filtering disabled on this server.</value>
</data>
<data name="permissions_word_filter_server_on" xml:space="preserve">
<value>Word filtering enabled on this server.</value>
</data>
<data name="utiliity_joined" xml:space="preserve"> <data name="utiliity_joined" xml:space="preserve">
<value>Joined</value> <value>Joined</value>
</data> </data>