Files
archived-discord-bot/CompatBot/Commands/Attributes/RequiresBotModRole.cs
13xforever 92751ba6e9 use file-scoped namespaces to reduce nesting
some formatting might be fucked
2022-06-30 00:59:46 +05:00

17 lines
549 B
C#

using System;
using System.Threading.Tasks;
using CompatBot.Database.Providers;
using DSharpPlus.CommandsNext;
namespace CompatBot.Commands.Attributes;
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
internal class RequiresBotModRole: CheckBaseAttributeWithReactions
{
public RequiresBotModRole() : base(reactOnFailure: Config.Reactions.Denied) { }
protected override Task<bool> IsAllowed(CommandContext ctx, bool help)
{
return Task.FromResult(ModProvider.IsMod(ctx.User.Id));
}
}