NadekoBot/NadekoBot.Core/Common/NoPublicBotPrecondition.cs

19 lines
534 B
C#
Raw Normal View History

2017-07-17 19:42:36 +00:00
using System;
using System.Threading.Tasks;
2017-07-17 19:42:36 +00:00
using Discord.Commands;
2017-07-17 19:42:36 +00:00
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
}
}
}