mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 01:08:26 -04:00
20 lines
621 B
C#
20 lines
621 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Discord.Commands;
|
|
|
|
namespace NadekoBot.Common
|
|
{
|
|
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
|
|
public sealed class NoPublicBotAttribute : PreconditionAttribute
|
|
{
|
|
public override Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
|
|
{
|
|
#if GLOBAL_NADEKO
|
|
return Task.FromResult(PreconditionResult.FromError("Not available on the public bot"));
|
|
#else
|
|
return Task.FromResult(PreconditionResult.FromSuccess());
|
|
#endif
|
|
}
|
|
}
|
|
}
|