.gc and stream follows should properly persist restarts
This commit is contained in:
		@@ -14,6 +14,7 @@ using NadekoBot.Services.Database.Models;
 | 
			
		||||
using Microsoft.EntityFrameworkCore;
 | 
			
		||||
using NadekoBot.Services.Administration;
 | 
			
		||||
using System.Diagnostics;
 | 
			
		||||
using NadekoBot.DataStructures;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Administration
 | 
			
		||||
{
 | 
			
		||||
@@ -207,12 +208,11 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
 | 
			
		||||
            //todo 2 shard commands
 | 
			
		||||
            //[NadekoCommand, Usage, Description, Aliases]
 | 
			
		||||
            //[Shard0Precondition]
 | 
			
		||||
            //[OwnerOnly]
 | 
			
		||||
            //public async Task ConnectShard(int shardid)
 | 
			
		||||
            //public async Task RestartShard(int shardid)
 | 
			
		||||
            //{
 | 
			
		||||
            //    var shard = _client.GetShard(shardid);
 | 
			
		||||
 | 
			
		||||
            //    if (shard == null)
 | 
			
		||||
            //    if (shardid == 0 || shardid > b)
 | 
			
		||||
            //    {
 | 
			
		||||
            //        await ReplyErrorLocalized("no_shard_id").ConfigureAwait(false);
 | 
			
		||||
            //        return;
 | 
			
		||||
 
 | 
			
		||||
@@ -116,7 +116,7 @@ namespace NadekoBot.Modules.Games
 | 
			
		||||
                bool enabled;
 | 
			
		||||
                using (var uow = _db.UnitOfWork)
 | 
			
		||||
                {
 | 
			
		||||
                    var guildConfig = uow.GuildConfigs.For(channel.Id, set => set.Include(gc => gc.GenerateCurrencyChannelIds));
 | 
			
		||||
                    var guildConfig = uow.GuildConfigs.For(channel.Guild.Id, set => set.Include(gc => gc.GenerateCurrencyChannelIds));
 | 
			
		||||
 | 
			
		||||
                    var toAdd = new GCChannelId() { ChannelId = channel.Id };
 | 
			
		||||
                    if (!guildConfig.GenerateCurrencyChannelIds.Contains(toAdd))
 | 
			
		||||
 
 | 
			
		||||
@@ -299,8 +299,6 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
                        Format.Bold(x.ConnectionState.ToString()), Format.Bold(x.Guilds.ToString())))
 | 
			
		||||
                .ToArray();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            await Context.Channel.SendPaginatedConfirmAsync(_client, page, (curPage) =>
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,8 +4,6 @@ using Discord.WebSocket;
 | 
			
		||||
using NadekoBot.Services;
 | 
			
		||||
using NadekoBot.Services.Impl;
 | 
			
		||||
using NLog;
 | 
			
		||||
using NLog.Config;
 | 
			
		||||
using NLog.Targets;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
@@ -28,8 +26,6 @@ using NadekoBot.Services.Help;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using NadekoBot.Services.Pokemon;
 | 
			
		||||
using NadekoBot.DataStructures.ShardCom;
 | 
			
		||||
using NadekoBot.DataStructures;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot
 | 
			
		||||
{
 | 
			
		||||
@@ -295,9 +291,10 @@ namespace NadekoBot
 | 
			
		||||
                    clientReady.TrySetResult(true);
 | 
			
		||||
                    try
 | 
			
		||||
                    {
 | 
			
		||||
                       await Task.WhenAll((await Client.GetDMChannelsAsync())
 | 
			
		||||
                            .Select(x => x.CloseAsync()))
 | 
			
		||||
                            .ConfigureAwait(false);
 | 
			
		||||
                        foreach (var chan in (await Client.GetDMChannelsAsync()))
 | 
			
		||||
                        {
 | 
			
		||||
                            await chan.CloseAsync().ConfigureAwait(false);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    catch
 | 
			
		||||
                    {
 | 
			
		||||
 
 | 
			
		||||
@@ -3096,14 +3096,14 @@
 | 
			
		||||
  <data name="shardstats_usage" xml:space="preserve">
 | 
			
		||||
    <value>`{0}shardstats` or `{0}shardstats 2`</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="connectshard_cmd" xml:space="preserve">
 | 
			
		||||
    <value>connectshard</value>
 | 
			
		||||
  <data name="restartshard_cmd" xml:space="preserve">
 | 
			
		||||
    <value>restartshard</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="connectshard_desc" xml:space="preserve">
 | 
			
		||||
  <data name="restartshard_desc" xml:space="preserve">
 | 
			
		||||
    <value>Try (re)connecting a shard with a certain shardid when it dies. No one knows will it work. Keep an eye on the console for errors.</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="connectshard_usage" xml:space="preserve">
 | 
			
		||||
    <value>`{0}connectshard 2`</value>
 | 
			
		||||
  <data name="restartshard_usage" xml:space="preserve">
 | 
			
		||||
    <value>`{0}restartshard 2`</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="shardid_cmd" xml:space="preserve">
 | 
			
		||||
    <value>shardid</value>
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,7 @@ namespace NadekoBot.Services.Database.Repositories.Impl
 | 
			
		||||
                .Include(gc => gc.SlowmodeIgnoredUsers)
 | 
			
		||||
                .Include(gc => gc.AntiSpamSetting)
 | 
			
		||||
                    .ThenInclude(x => x.IgnoredChannels)
 | 
			
		||||
                .Include(gc => gc.FollowedStreams)
 | 
			
		||||
                .ToList();
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user