Update Permissions.cs
- added emojis
This commit is contained in:
parent
43b5d0695a
commit
d7fe2fda9e
@ -62,7 +62,7 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
await uow.CompleteAsync().ConfigureAwait(false);
|
await uow.CompleteAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
await channel.SendMessageAsync("I will " + (action.Value ? "now" : "no longer") + " show permission warnings.").ConfigureAwait(false);
|
await channel.SendMessageAsync("ℹ️ I will " + (action.Value ? "now" : "no longer") + " show permission warnings.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -75,7 +75,7 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
var config = uow.GuildConfigs.For(channel.Guild.Id);
|
var config = uow.GuildConfigs.For(channel.Guild.Id);
|
||||||
if (role == null)
|
if (role == null)
|
||||||
{
|
{
|
||||||
await channel.SendMessageAsync($"Current permission role is **{config.PermissionRole}**.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"ℹ️ Current permission role is **{config.PermissionRole}**.").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -90,7 +90,7 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await channel.SendMessageAsync($"Users now require **{role.Name}** role in order to edit permissions.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"✅ Users now require **{role.Name}** role in order to edit permissions.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -106,11 +106,11 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
{
|
{
|
||||||
var perms = uow.GuildConfigs.PermissionsFor(channel.Guild.Id).RootPermission;
|
var perms = uow.GuildConfigs.PermissionsFor(channel.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(channel.Guild) + " [uneditable]") : (p.GetCommand(channel.Guild)))}"));
|
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(channel.Guild) + " [uneditable]") : (p.GetCommand(channel.Guild)))}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(toSend))
|
if (string.IsNullOrWhiteSpace(toSend))
|
||||||
await channel.SendMessageAsync("`No permissions set.`").ConfigureAwait(false);
|
await channel.SendMessageAsync("❗️`No permissions set.`").ConfigureAwait(false);
|
||||||
else
|
else
|
||||||
await channel.SendMessageAsync(toSend).ConfigureAwait(false);
|
await channel.SendMessageAsync(toSend).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@ -156,11 +156,11 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
uow2._context.SaveChanges();
|
uow2._context.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
await channel.SendMessageAsync($"{imsg.Author.Mention} removed permission **{p.GetCommand(channel.Guild)}** from position #{index + 1}.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"✅ {imsg.Author.Mention} removed permission **{p.GetCommand(channel.Guild)}** from position #{index + 1}.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
await channel.SendMessageAsync("`No command on that index found.`").ConfigureAwait(false);
|
await channel.SendMessageAsync("❗️`No command on that index found.`").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,13 +208,13 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
{
|
{
|
||||||
if (!fromFound)
|
if (!fromFound)
|
||||||
{
|
{
|
||||||
await channel.SendMessageAsync($"`Can't find permission at index `#{++from}`").ConfigureAwait(false);
|
await channel.SendMessageAsync($"❗️`Can't find permission at index `#{++from}`").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!toFound)
|
if (!toFound)
|
||||||
{
|
{
|
||||||
await channel.SendMessageAsync($"`Can't find permission at index `#{++to}`").ConfigureAwait(false);
|
await channel.SendMessageAsync($"❗️`Can't find permission at index `#{++to}`").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,7 +264,7 @@ 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 channel.SendMessageAsync($"`Moved permission:` \"{fromPerm.GetCommand(channel.Guild)}\" `from #{++from} to #{++to}.`").ConfigureAwait(false);
|
await channel.SendMessageAsync($"✅ `Moved permission:` \"{fromPerm.GetCommand(channel.Guild)}\" `from #{++from} to #{++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)
|
||||||
@ -300,7 +300,7 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
|
|
||||||
await uow.CompleteAsync().ConfigureAwait(false);
|
await uow.CompleteAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
await channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `{command.Text}` command on this server.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `{command.Text}` command on this server.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -328,7 +328,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `{module.Name}` module on this server.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of **`{module.Name}`** module on this server.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -356,7 +356,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `{command.Text}` command for `{user}` user.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `{command.Text}` command for `{user}` user.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -384,7 +384,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `{module.Name}` module for `{user}` user.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `{module.Name}` module for `{user}` user.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -412,7 +412,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `{command.Text}` command for `{role}` role.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `{command.Text}` command for `{role}` role.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -440,7 +440,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `{module.Name}` module for `{role}` role.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `{module.Name}` module for `{role}` role.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -473,7 +473,7 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Console.WriteLine(ex);
|
Console.WriteLine(ex);
|
||||||
}
|
}
|
||||||
await channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `{command.Text}` command for `{chnl}` channel.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `{command.Text}` command for `{chnl}` channel.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -501,7 +501,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `{module.Name}` module for `{chnl}` channel.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `{module.Name}` module for `{chnl}` channel.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -529,7 +529,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `ALL MODULES` for `{chnl}` channel.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `ALL MODULES` for `{chnl}` channel.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -557,7 +557,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `ALL MODULES` for `{role}` role.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `ALL MODULES` for `{role}` role.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -585,7 +585,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `ALL MODULES` for `{user}` user.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `ALL MODULES` for `{user}` user.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -624,7 +624,7 @@ 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 channel.SendMessageAsync($"{(action.Value ? "Allowed" : "Denied")} usage of `ALL MODULES` on this server.").ConfigureAwait(false);
|
await channel.SendMessageAsync($"{(action.Value ? "✅ Allowed" : "❎ Denied")} usage of `ALL MODULES` on this server.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user