-
Notifications
You must be signed in to change notification settings - Fork 0
Configuring bot with ASP.NET WebApi hosting
Mikhail edited this page Jan 11, 2021
·
2 revisions
In the case of using ASP.NET WebApi hosting, bot will use Webhook
to receive updates.
Example of Startup.cs class:
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddSpire(configurator =>
{
configurator.WithConfigurationOptions();
configurator.ConfigureBotHost(webHost
=>
{
webHost.WithBot(BuildMyBot);
});
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();
app.UseSpire();
}
public IBot BuildMyBot(BotConfigurationOptions configurationOptions)
{
//Configure your bot here.
}
}