fixed public bot compilation issue for good
This commit is contained in:
parent
3709f4b066
commit
db1581f67d
@ -26,6 +26,8 @@ using NadekoBot.Services.Help;
|
||||
using System.IO;
|
||||
using NadekoBot.Services.Pokemon;
|
||||
using NadekoBot.DataStructures.ShardCom;
|
||||
using NadekoBot.DataStructures;
|
||||
using NadekoBot.Extensions;
|
||||
|
||||
namespace NadekoBot
|
||||
{
|
||||
@ -346,6 +348,10 @@ namespace NadekoBot
|
||||
var _ = await CommandService.AddModulesAsync(this.GetType().GetTypeInfo().Assembly);
|
||||
|
||||
|
||||
bool isPublicNadeko = false;
|
||||
#if GLOBAL_NADEKO
|
||||
isPublicNadeko = true;
|
||||
#endif
|
||||
//Console.WriteLine(string.Join(", ", CommandService.Commands
|
||||
// .Distinct(x => x.Name + x.Module.Name)
|
||||
// .SelectMany(x => x.Aliases)
|
||||
@ -354,13 +360,13 @@ namespace NadekoBot
|
||||
// .Select(x => x.Key + $"({x.Count()})")));
|
||||
|
||||
//unload modules which are not available on the public bot
|
||||
#if GLOBAL_NADEKO
|
||||
|
||||
if(isPublicNadeko)
|
||||
CommandService
|
||||
.Modules
|
||||
.ToArray()
|
||||
.Where(x => x.Preconditions.Any(y => y.GetType() == typeof(NoPublicBot)))
|
||||
.ForEach(x => CommandService.RemoveModuleAsync(x));
|
||||
#endif
|
||||
|
||||
Ready = true;
|
||||
_log.Info($"Shard {ShardId} ready.");
|
||||
|
Loading…
Reference in New Issue
Block a user