2023-02-13 16:34:22 -05:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace TeleTok
|
|
|
|
|
{
|
2023-02-14 12:04:24 -05:00
|
|
|
|
public class TeleTok
|
2023-02-13 16:34:22 -05:00
|
|
|
|
{
|
2023-02-14 12:04:24 -05:00
|
|
|
|
public static IConfigurationRoot config = new ConfigurationBuilder()
|
|
|
|
|
.SetBasePath(Directory.GetCurrentDirectory())
|
|
|
|
|
.AddJsonFile("config.json", true)
|
|
|
|
|
.Build();
|
2023-02-13 16:34:22 -05:00
|
|
|
|
|
2023-02-14 12:04:24 -05:00
|
|
|
|
public static string token = config.GetSection("TeleTokConf:token").Value;
|
|
|
|
|
public static string ptInstance = config.GetSection("TeleTokConf:proxitokInstance").Value;
|
2023-02-13 16:34:22 -05:00
|
|
|
|
|
2023-02-14 12:04:24 -05:00
|
|
|
|
static async Task Main(string[] args)
|
|
|
|
|
{
|
2023-02-13 19:18:49 -05:00
|
|
|
|
|
2023-02-14 12:29:11 -05:00
|
|
|
|
TelegramListener listener = new TelegramListener();
|
2023-02-14 13:59:20 -05:00
|
|
|
|
Console.WriteLine("Now listening...");
|
|
|
|
|
|
|
|
|
|
listener.RunListener();
|
2023-02-14 12:29:11 -05:00
|
|
|
|
|
2023-02-13 16:34:22 -05:00
|
|
|
|
}
|
2023-02-15 12:17:08 -05:00
|
|
|
|
|
|
|
|
|
public static void LogMessage(string text)
|
|
|
|
|
{
|
|
|
|
|
DateTime now =DateTime.Now;
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("[" + now.ToString() + "] " + text);
|
|
|
|
|
}
|
2023-02-13 16:34:22 -05:00
|
|
|
|
}
|
|
|
|
|
}
|