mirror of
https://github.com/yawaflua/Telegram.Net.git
synced 2025-12-08 19:49:30 +02:00
18 lines
506 B
C#
18 lines
506 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Logging;
|
|
using Telegram.Net;
|
|
|
|
var webHost = Host.CreateDefaultBuilder()
|
|
.ConfigureLogging(l => l.ClearProviders().AddConsole())
|
|
.ConfigureServices(k =>
|
|
{
|
|
k.ConnectTelegram(new("TOKEN")
|
|
{
|
|
errorHandler = async (client, exception, ctx) =>
|
|
{
|
|
Console.WriteLine(exception);
|
|
}
|
|
});
|
|
});
|
|
webHost.Build().Run(); |