Replace fix "token" string with environment variable

This commit is contained in:
Florian Zevedei 2023-12-10 17:48:02 +01:00
parent 76512f1af4
commit 9b3e3de55d

View File

@ -23,7 +23,7 @@ public class Program
{ {
var bot = BotBaseBuilder var bot = BotBaseBuilder
.Create() .Create()
.WithAPIKey("token") .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set"))
.MiddlewareMessageLoop( .MiddlewareMessageLoop(
messageLoop => messageLoop =>
messageLoop messageLoop
@ -68,7 +68,7 @@ public class Program
{ {
var bot = BotBaseBuilder var bot = BotBaseBuilder
.Create() .Create()
.WithAPIKey("token") .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set"))
.MiddlewareMessageLoop( .MiddlewareMessageLoop(
messageLoop => messageLoop =>
messageLoop messageLoop
@ -103,7 +103,7 @@ public class Program
{ {
var bot = BotBaseBuilder var bot = BotBaseBuilder
.Create() .Create()
.WithAPIKey("token") .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set"))
.MiddlewareMessageLoop( .MiddlewareMessageLoop(
messageLoop => messageLoop =>
messageLoop messageLoop
@ -136,7 +136,7 @@ public class Program
{ {
var bot = BotBaseBuilder var bot = BotBaseBuilder
.Create() .Create()
.WithAPIKey("token") .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set"))
.MiddlewareMessageLoop( .MiddlewareMessageLoop(
messageLoop => messageLoop =>
messageLoop messageLoop
@ -159,7 +159,7 @@ public class Program
{ {
var bot = BotBaseBuilder var bot = BotBaseBuilder
.Create() .Create()
.WithAPIKey("token") .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set"))
.MiddlewareMessageLoop( .MiddlewareMessageLoop(
messageLoop => messageLoop =>
messageLoop messageLoop
@ -178,7 +178,7 @@ public class Program
{ {
var bot = BotBaseBuilder var bot = BotBaseBuilder
.Create() .Create()
.WithAPIKey("token") .WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set"))
.MiddlewareMessageLoop( .MiddlewareMessageLoop(
messageLoop => messageLoop =>
messageLoop messageLoop