Added json field checks

This commit is contained in:
Chris Plaatjes 2023-02-15 13:53:47 -05:00
parent 8ab6b9d986
commit 268bbdf9b7
1 changed files with 15 additions and 5 deletions

View File

@ -15,12 +15,22 @@ namespace TeleTok
static async Task Main(string[] args)
{
TelegramListener listener = new TelegramListener();
Console.WriteLine("Now listening...");
//Checks if the config json data is valid
if(token == "" || token == null || token == "INSERT TOKEN HERE")
{
LogMessage("Telegram bot token is invalid! Exiting...");
}
else if(ptInstance == "" || ptInstance == null || ptInstance == "PROXITOK INSTANCE URL")
{
LogMessage("Proxitok instance is invalid! Exiting...");
}
else
{
TelegramListener listener = new TelegramListener();
Console.WriteLine("Now listening...");
listener.RunListener();
listener.RunListener();
}
}
public static void LogMessage(string text)