From 0f7dd7708ee89f9f1cfb5646b3dbb103eac48783 Mon Sep 17 00:00:00 2001 From: Christophe Chailloleau-Leclerc Date: Thu, 30 May 2019 08:25:22 +0200 Subject: [PATCH] =?UTF-8?q?Arr=C3=AAt=20plus=20propre=20et=20qui=20n'emp?= =?UTF-8?q?=C3=AAche=20plus=20de=20se=20reconnecter=20automatiquement=20en?= =?UTF-8?q?=20cas=20de=20perte=20de=20r=C3=A9seau=20(normalement=20:)=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sean/Modules/DMModule.cs | 1 + Sean/Program.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Sean/Modules/DMModule.cs b/Sean/Modules/DMModule.cs index 8983629..2ceb60d 100644 --- a/Sean/Modules/DMModule.cs +++ b/Sean/Modules/DMModule.cs @@ -30,6 +30,7 @@ namespace Sean.Modules await guild.DefaultChannel.SendMessageAsync("Ciao les nazes !"); } await Context.Client.StopAsync(); + Environment.Exit(0); } #endregion Methods diff --git a/Sean/Program.cs b/Sean/Program.cs index 6ad2514..9508536 100644 --- a/Sean/Program.cs +++ b/Sean/Program.cs @@ -47,16 +47,16 @@ namespace Sean await client.LoginAsync(TokenType.Bot, Environment.GetEnvironmentVariable("DiscordToken_Sean")); await client.StartAsync(); - client.Disconnected += Client_Disconnected; + //client.Disconnected += Client_Disconnected; // Block this task until the program is closed. await Task.Delay(-1); } - private Task Client_Disconnected(Exception arg) - { - Environment.Exit(0); - return Task.CompletedTask; - } + //private Task Client_Disconnected(Exception arg) + //{ + // Environment.Exit(0); + // return Task.CompletedTask; + //} private static void Main(string[] args) {