Added json field checks

This commit is contained in:
Chris Plaatjes 2023-02-15 13:53:47 -05:00
parent 8ab6b9d986
commit 268bbdf9b7

View File

@ -15,12 +15,22 @@ namespace TeleTok
static async Task Main(string[] args) static async Task Main(string[] args)
{ {
//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(); TelegramListener listener = new TelegramListener();
Console.WriteLine("Now listening..."); Console.WriteLine("Now listening...");
listener.RunListener(); listener.RunListener();
}
} }
public static void LogMessage(string text) public static void LogMessage(string text)