first commit
This commit is contained in:
commit
f680dd869b
6 changed files with 166 additions and 0 deletions
18
commands/admin.cs
Normal file
18
commands/admin.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using DSharpPlus.CommandsNext;
|
||||
using DSharpPlus.CommandsNext.Attributes;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
|
||||
public class HasAdminRole : CheckBaseAttribute
|
||||
{
|
||||
public override async Task<bool> ExecuteCheckAsync(CommandContext ctx, bool help)
|
||||
{
|
||||
bool hasAdminRole = ctx.Member?.Roles.Any(role => role.Name == "Admin") ?? false;
|
||||
if (!hasAdminRole)
|
||||
{
|
||||
await ctx.RespondAsync("Csicskáknak kuss van !");
|
||||
}
|
||||
return (hasAdminRole);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue