microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Samples/Samples.BotBuilder/Program.cs
23lines · modecode
| 1 | using Microsoft.Bot.Builder.Integration.AspNet.Core; |
| 2 | using Microsoft.Teams.Apps.Activities; |
| 3 | using Microsoft.Teams.Apps.Extensions; |
| 4 | using Microsoft.Teams.Plugins.AspNetCore.Extensions; |
| 5 | |
| 6 | using Samples.BotBuilder; |
| 7 | |
| 8 | var builder = WebApplication.CreateBuilder(args); |
| 9 | builder |
| 10 | .AddTeams() |
| 11 | .AddBotBuilder<Bot, BotBuilderAdapter, ConfigurationBotFrameworkAuthentication>(); |
| 12 | |
| 13 | var app = builder.Build(); |
| 14 | |
| 15 | var teams = app.UseTeams(); |
| 16 | |
| 17 | teams.OnMessage(async (context, cancellationToken) => |
| 18 | { |
| 19 | await context.Typing(cancellationToken: cancellationToken); |
| 20 | await context.Send("hi from teams...", cancellationToken); |
| 21 | }); |
| 22 | |
| 23 | app.Run(); |