From b4f3e8737c46f8fa36e3d8aa549b7d2d5e914153 Mon Sep 17 00:00:00 2001 From: Monster1025 Date: Fri, 5 Feb 2021 21:20:56 +0300 Subject: [PATCH] ok --- src/RgDevBot/TelegramBot.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/RgDevBot/TelegramBot.cs b/src/RgDevBot/TelegramBot.cs index 3c2cc38..6834507 100644 --- a/src/RgDevBot/TelegramBot.cs +++ b/src/RgDevBot/TelegramBot.cs @@ -13,14 +13,14 @@ namespace RgDevBot var token = Environment.GetEnvironmentVariable("TELEGRAM_TOKEN"); if (string.IsNullOrEmpty(token)) { - Console.WriteLine("Please define TELEGRAM_TOKEN variable."); - return; + throw new Exception("Please define TELEGRAM_TOKEN variable."); + } - int.TryParse(Environment.GetEnvironmentVariable("TELEGRAM_CHAT_ID"), out var chatId); + + long.TryParse(Environment.GetEnvironmentVariable("TELEGRAM_CHAT_ID"), out var chatId); if (chatId == 0) { - Console.WriteLine("Please define TELEGRAM_CHAT_ID variable."); - return; + throw new Exception("Please define TELEGRAM_CHAT_ID variable."); } MainChatId = chatId;