Add project files.

This commit is contained in:
Wizzy69
2022-01-07 20:26:10 +02:00
parent 8b8d4c7147
commit 84ee5c6235
53 changed files with 3544 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using Discord;
using Discord.WebSocket;
using System.Linq;
namespace PluginManager.Others
{
public static class Permissions
{
public static bool hasPermission(this IRole role, GuildPermission permission) => role.Permissions.Has(permission);
public static bool hasRole(this SocketGuildUser user, IRole role) => user.Roles.Contains(role);
public static bool hasPermission(this SocketGuildUser user, GuildPermission permission)
=> user.Roles.Where(role => role.hasPermission(permission)).Any();
}
}