Initial split of the modules
This commit is contained in:
18
NadekoBot.Core/Common/NoPublicBotPrecondition.cs
Normal file
18
NadekoBot.Core/Common/NoPublicBotPrecondition.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Discord.Commands;
|
||||
|
||||
namespace NadekoBot.Common
|
||||
{
|
||||
public class NoPublicBot : PreconditionAttribute
|
||||
{
|
||||
public override Task<PreconditionResult> CheckPermissions(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
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user