2017-07-17 19:42:36 +00:00
|
|
|
|
using System;
|
2017-05-29 04:13:22 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2017-07-17 19:42:36 +00:00
|
|
|
|
using Discord.Commands;
|
2017-05-29 04:13:22 +00:00
|
|
|
|
|
2017-07-17 19:42:36 +00:00
|
|
|
|
namespace NadekoBot.Common
|
2017-05-29 04:13:22 +00:00
|
|
|
|
{
|
|
|
|
|
public class NoPublicBot : PreconditionAttribute
|
|
|
|
|
{
|
2017-11-29 06:53:16 +00:00
|
|
|
|
public override Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
|
2017-05-29 04:13:22 +00:00
|
|
|
|
{
|
|
|
|
|
#if GLOBAL_NADEKo
|
|
|
|
|
return Task.FromResult(PreconditionResult.FromError("Not available on the public bot"));
|
|
|
|
|
#else
|
|
|
|
|
return Task.FromResult(PreconditionResult.FromSuccess());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|