diff options
author | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
---|---|---|
committer | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
commit | e6181c24124d97f2fbc932b8a68311e625463156 (patch) | |
tree | c1f097c344ca266b7941c9668590b0fd35c7870a /DiscoBot/Auxiliary/Permissions.cs | |
parent | 2490ad5d31fe2ac778ff9303776f0e91f47a2862 (diff) |
Move dsa related stuff to subfolder
Diffstat (limited to 'DiscoBot/Auxiliary/Permissions.cs')
-rw-r--r-- | DiscoBot/Auxiliary/Permissions.cs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/DiscoBot/Auxiliary/Permissions.cs b/DiscoBot/Auxiliary/Permissions.cs deleted file mode 100644 index 3ec4a2e..0000000 --- a/DiscoBot/Auxiliary/Permissions.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Discord.Commands; -using Discord.WebSocket; - -namespace DiscoBot.Auxiliary -{ - 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, IEnumerable<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)) return true; - c.Channel.SendMessageAsync("```xl\n Keine ausreichenden Berechtigungen\n```").Wait(); - return false; - } - - public static void Test(ICommandContext c, string[] roles) - { - if (!Check(c, roles)) c.Channel.SendMessageAsync("```xl\n Keine ausreichenden Berechtigungen\n```").Wait(); - } - } -}
\ No newline at end of file |