mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-14 06:18:42 +00:00
18 lines
595 B
C#
18 lines
595 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 RequiresBotSudoerRole: CheckBaseAttributeWithReactions
|
|
{
|
|
public RequiresBotSudoerRole(): base(reactOnFailure: Config.Reactions.Denied) { }
|
|
|
|
protected override Task<bool> IsAllowed(CommandContext ctx, bool help)
|
|
{
|
|
return Task.FromResult(ModProvider.IsSudoer(ctx.User.Id));
|
|
}
|
|
}
|
|
} |