use the existing restart command instead of just dying (._.)

This commit is contained in:
13xforever 2019-04-21 22:38:20 +05:00
parent cae0c4f743
commit 3c99a237d2
2 changed files with 3 additions and 2 deletions

View File

@ -20,7 +20,7 @@ namespace CompatBot
{
private static readonly SemaphoreSlim InstanceCheck = new SemaphoreSlim(0, 1);
private static readonly SemaphoreSlim ShutdownCheck = new SemaphoreSlim(0, 1);
private const ulong InvalidChannelId = 13;
internal const ulong InvalidChannelId = 13;
internal static async Task Main(string[] args)
{

View File

@ -3,6 +3,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using CompatBot.Commands;
using DSharpPlus;
namespace CompatBot
@ -24,7 +25,7 @@ namespace CompatBot
{
var ch = await client.GetChannelAsync(Config.BotSpamId).ConfigureAwait(false);
await client.SendMessageAsync(ch, "Potential socket deadlock detected, restarting...").ConfigureAwait(false);
Config.Cts.Cancel(false);
Sudo.Bot.Restart(Program.InvalidChannelId);
}
catch (Exception e)
{