* Added integration addon wit WTelegramBot (WIP)

* Added some extensions methods
* Refactored Result behaviour
* Added missing exception messages
* Removed telegrator-specific host builder (obsolete)
* Code cleanup and bug fixes
This commit is contained in:
gutii
2026-04-27 09:56:44 +04:00
parent 06a021de49
commit aba9cf4037
36 changed files with 814 additions and 990 deletions
+2 -40
View File
@@ -6,25 +6,8 @@ using Telegrator.Hosting.Web;
namespace Telegrator;
internal class Program
internal static class Program
{
public static void TelegramBotWebHostBuilder_Example(string[] args)
{
TelegramBotWebHostBuilder builder = TelegramBotWebHost.CreateBuilder(new WebApplicationOptions()
{
Args = args,
ApplicationName = "TelegramBotWebHost example",
});
builder.Handlers
.CollectHandlersAssemblyWide();
builder.Build()
.AddLoggingAdapter()
.SetBotCommands()
.Run();
}
public static void WebApplicationBuilder_Example(string[] args)
{
WebApplicationBuilder builder = WebApplication.CreateBuilder(new WebApplicationOptions()
@@ -38,28 +21,7 @@ internal class Program
builder.Build()
.UseTelegratorWeb(dontMap: true)
.RemapWebhook("https://awesome-butt-sex.cloudpub.ru/")
.AddLoggingAdapter()
.SetBotCommands()
.Run();
}
public static void TelegramBotHostBuilder_Example(string[] args)
{
ConfigurationManager configuration = new ConfigurationManager();
configuration.AddJsonFile("appsettings.json");
TelegramBotHostBuilder builder = TelegramBotHost.CreateBuilder(new HostApplicationBuilderSettings()
{
Args = args,
ApplicationName = "TelegramBotHost example",
Configuration = configuration
});
builder.Handlers
.CollectHandlersAssemblyWide();
builder.Build()
.RemapWebhook("https://amazing-butt-sex.cloudpub.ru/")
.AddLoggingAdapter()
.SetBotCommands()
.Run();