From 9b3e3de55df176ea66f953d92a330c4d2ce25ed7 Mon Sep 17 00:00:00 2001 From: Florian Zevedei Date: Sun, 10 Dec 2023 17:48:02 +0100 Subject: [PATCH] Replace fix "token" string with environment variable --- Examples/MiddlewareBaseBot/Program.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Examples/MiddlewareBaseBot/Program.cs b/Examples/MiddlewareBaseBot/Program.cs index 97f7441..559e529 100644 --- a/Examples/MiddlewareBaseBot/Program.cs +++ b/Examples/MiddlewareBaseBot/Program.cs @@ -23,7 +23,7 @@ public class Program { var bot = BotBaseBuilder .Create() - .WithAPIKey("token") + .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set")) .MiddlewareMessageLoop( messageLoop => messageLoop @@ -68,7 +68,7 @@ public class Program { var bot = BotBaseBuilder .Create() - .WithAPIKey("token") + .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set")) .MiddlewareMessageLoop( messageLoop => messageLoop @@ -103,7 +103,7 @@ public class Program { var bot = BotBaseBuilder .Create() - .WithAPIKey("token") + .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set")) .MiddlewareMessageLoop( messageLoop => messageLoop @@ -136,7 +136,7 @@ public class Program { var bot = BotBaseBuilder .Create() - .WithAPIKey("token") + .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set")) .MiddlewareMessageLoop( messageLoop => messageLoop @@ -159,7 +159,7 @@ public class Program { var bot = BotBaseBuilder .Create() - .WithAPIKey("token") + .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set")) .MiddlewareMessageLoop( messageLoop => messageLoop @@ -178,7 +178,7 @@ public class Program { var bot = BotBaseBuilder .Create() - .WithAPIKey("token") + .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set")) .MiddlewareMessageLoop( messageLoop => messageLoop