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:
parent
c5b30354fc
commit
0f7dd7708e
@ -30,6 +30,7 @@ namespace Sean.Modules
|
||||
await guild.DefaultChannel.SendMessageAsync("Ciao les nazes !");
|
||||
}
|
||||
await Context.Client.StopAsync();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user