NadekoBot/NadekoBot.Core/Common/NoPublicBotPrecondition.cs

19 lines
534 B
C#

using System;
using System.Threading.Tasks;
using Discord.Commands;
namespace NadekoBot.Common
{
public class NoPublicBot : 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
}
}
}