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 System.IO;
|
||||||
using NadekoBot.Services.Pokemon;
|
using NadekoBot.Services.Pokemon;
|
||||||
using NadekoBot.DataStructures.ShardCom;
|
using NadekoBot.DataStructures.ShardCom;
|
||||||
|
using NadekoBot.DataStructures;
|
||||||
|
using NadekoBot.Extensions;
|
||||||
|
|
||||||
namespace NadekoBot
|
namespace NadekoBot
|
||||||
{
|
{
|
||||||
@ -346,6 +348,10 @@ namespace NadekoBot
|
|||||||
var _ = await CommandService.AddModulesAsync(this.GetType().GetTypeInfo().Assembly);
|
var _ = await CommandService.AddModulesAsync(this.GetType().GetTypeInfo().Assembly);
|
||||||
|
|
||||||
|
|
||||||
|
bool isPublicNadeko = false;
|
||||||
|
#if GLOBAL_NADEKO
|
||||||
|
isPublicNadeko = true;
|
||||||
|
#endif
|
||||||
//Console.WriteLine(string.Join(", ", CommandService.Commands
|
//Console.WriteLine(string.Join(", ", CommandService.Commands
|
||||||
// .Distinct(x => x.Name + x.Module.Name)
|
// .Distinct(x => x.Name + x.Module.Name)
|
||||||
// .SelectMany(x => x.Aliases)
|
// .SelectMany(x => x.Aliases)
|
||||||
@ -353,14 +359,14 @@ namespace NadekoBot
|
|||||||
// .Where(x => x.Count() > 1)
|
// .Where(x => x.Count() > 1)
|
||||||
// .Select(x => x.Key + $"({x.Count()})")));
|
// .Select(x => x.Key + $"({x.Count()})")));
|
||||||
|
|
||||||
//unload modules which are not available on the public bot
|
//unload modules which are not available on the public bot
|
||||||
#if GLOBAL_NADEKO
|
|
||||||
CommandService
|
if(isPublicNadeko)
|
||||||
.Modules
|
CommandService
|
||||||
.ToArray()
|
.Modules
|
||||||
.Where(x => x.Preconditions.Any(y => y.GetType() == typeof(NoPublicBot)))
|
.ToArray()
|
||||||
.ForEach(x => CommandService.RemoveModuleAsync(x));
|
.Where(x => x.Preconditions.Any(y => y.GetType() == typeof(NoPublicBot)))
|
||||||
#endif
|
.ForEach(x => CommandService.RemoveModuleAsync(x));
|
||||||
|
|
||||||
Ready = true;
|
Ready = true;
|
||||||
_log.Info($"Shard {ShardId} ready.");
|
_log.Info($"Shard {ShardId} ready.");
|
||||||
|
Loading…
Reference in New Issue
Block a user