This commit is contained in:
2021-02-05 21:20:56 +03:00
parent 0908f2bb7f
commit b4f3e8737c
+5 -5
View File
@@ -13,14 +13,14 @@ namespace RgDevBot
var token = Environment.GetEnvironmentVariable("TELEGRAM_TOKEN"); var token = Environment.GetEnvironmentVariable("TELEGRAM_TOKEN");
if (string.IsNullOrEmpty(token)) if (string.IsNullOrEmpty(token))
{ {
Console.WriteLine("Please define TELEGRAM_TOKEN variable."); throw new Exception("Please define TELEGRAM_TOKEN variable.");
return;
} }
int.TryParse(Environment.GetEnvironmentVariable("TELEGRAM_CHAT_ID"), out var chatId);
long.TryParse(Environment.GetEnvironmentVariable("TELEGRAM_CHAT_ID"), out var chatId);
if (chatId == 0) if (chatId == 0)
{ {
Console.WriteLine("Please define TELEGRAM_CHAT_ID variable."); throw new Exception("Please define TELEGRAM_CHAT_ID variable.");
return;
} }
MainChatId = chatId; MainChatId = chatId;