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