From 19bf37de7642ae8cdefd8fc6b4fadac3ac96ea9b Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Wed, 26 Sep 2018 23:49:26 +0200 Subject: ported most code to WebApiProject everything except the user identification and file locations should be somewhat functional --- DiscoBot/Auxiliary/Permissions.cs | 43 --------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 DiscoBot/Auxiliary/Permissions.cs (limited to 'DiscoBot/Auxiliary/Permissions.cs') diff --git a/DiscoBot/Auxiliary/Permissions.cs b/DiscoBot/Auxiliary/Permissions.cs deleted file mode 100644 index 4d73146..0000000 --- a/DiscoBot/Auxiliary/Permissions.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace DiscoBot.Auxiliary -{ - using Discord.Commands; - using Discord.WebSocket; - - public static class Permissions - { - public static bool Check(ICommandContext c, string role) - { - return ((SocketGuildUser)c.User).Roles.ToList().Exists(v => v.Name.Equals(role)); - } - - public static bool Check(ICommandContext c, string[] roles) - { - return roles.Any(role => ((SocketGuildUser)c.User).Roles.ToList().Exists(v => v.Name.Equals(role))); - } - - public static bool Test(ICommandContext c, string role) - { - if (!Check(c, role)) - { - c.Channel.SendMessageAsync("```xl\n Keine ausreichenden Berechtigungen\n```").Wait(); - return false; - } - - return true; - } - - public static void Test(ICommandContext c, string[] roles) - { - if (!Check(c, roles)) - { - c.Channel.SendMessageAsync("```xl\n Keine ausreichenden Berechtigungen\n```").Wait(); - } - } - } -} -- cgit v1.2.3-54-g00ecf