* 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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user