From b6c981227d5adcb3af12e402af83ed92d76c0586 Mon Sep 17 00:00:00 2001 From: Arnav Borborah Date: Thu, 7 May 2020 09:14:37 -0400 Subject: [PATCH] docs: Use `Timeout.Infinite` instead of -1 so that intent is clearer (#1443) --- samples/01_basic_ping_bot/Program.cs | 3 ++- samples/02_commands_framework/Program.cs | 3 ++- samples/03_sharded_client/Program.cs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/samples/01_basic_ping_bot/Program.cs b/samples/01_basic_ping_bot/Program.cs index 4d6674e97..7fbe04993 100644 --- a/samples/01_basic_ping_bot/Program.cs +++ b/samples/01_basic_ping_bot/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Threading; using System.Threading.Tasks; using Discord; using Discord.WebSocket; @@ -43,7 +44,7 @@ namespace _01_basic_ping_bot await _client.StartAsync(); // Block the program until it is closed. - await Task.Delay(-1); + await Task.Delay(Timeout.Infinite); } private Task LogAsync(LogMessage log) diff --git a/samples/02_commands_framework/Program.cs b/samples/02_commands_framework/Program.cs index ccbc8e165..67cb87764 100644 --- a/samples/02_commands_framework/Program.cs +++ b/samples/02_commands_framework/Program.cs @@ -1,5 +1,6 @@ using System; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Discord; @@ -45,7 +46,7 @@ namespace _02_commands_framework // Here we initialize the logic required to register our commands. await services.GetRequiredService().InitializeAsync(); - await Task.Delay(-1); + await Task.Delay(Timeout.Infinite); } } diff --git a/samples/03_sharded_client/Program.cs b/samples/03_sharded_client/Program.cs index 7a2f99168..753f400a1 100644 --- a/samples/03_sharded_client/Program.cs +++ b/samples/03_sharded_client/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Threading; using System.Threading.Tasks; using _03_sharded_client.Services; using Discord; @@ -45,7 +46,7 @@ namespace _03_sharded_client await client.LoginAsync(TokenType.Bot, Environment.GetEnvironmentVariable("token")); await client.StartAsync(); - await Task.Delay(-1); + await Task.Delay(Timeout.Infinite); } }