Arrêt plus propre et qui n'empêche plus de se reconnecter automatiquement en cas de perte de réseau (normalement :) )
This commit is contained in:
		@@ -30,6 +30,7 @@ namespace Sean.Modules
 | 
				
			|||||||
                await guild.DefaultChannel.SendMessageAsync("Ciao les nazes !");
 | 
					                await guild.DefaultChannel.SendMessageAsync("Ciao les nazes !");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            await Context.Client.StopAsync();
 | 
					            await Context.Client.StopAsync();
 | 
				
			||||||
 | 
					            Environment.Exit(0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #endregion Methods
 | 
					        #endregion Methods
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,16 +47,16 @@ namespace Sean
 | 
				
			|||||||
            await client.LoginAsync(TokenType.Bot, Environment.GetEnvironmentVariable("DiscordToken_Sean"));
 | 
					            await client.LoginAsync(TokenType.Bot, Environment.GetEnvironmentVariable("DiscordToken_Sean"));
 | 
				
			||||||
            await client.StartAsync();
 | 
					            await client.StartAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            client.Disconnected += Client_Disconnected;
 | 
					            //client.Disconnected += Client_Disconnected;
 | 
				
			||||||
            // Block this task until the program is closed.
 | 
					            // Block this task until the program is closed.
 | 
				
			||||||
            await Task.Delay(-1);
 | 
					            await Task.Delay(-1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private Task Client_Disconnected(Exception arg)
 | 
					        //private Task Client_Disconnected(Exception arg)
 | 
				
			||||||
        {
 | 
					        //{
 | 
				
			||||||
            Environment.Exit(0);
 | 
					        //    Environment.Exit(0);
 | 
				
			||||||
            return Task.CompletedTask; 
 | 
					        //    return Task.CompletedTask; 
 | 
				
			||||||
        }
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private static void Main(string[] args)
 | 
					        private static void Main(string[] args)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user