microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/samples/CustomHosting/MyTeamsBotApp.cs
21lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using Microsoft.Teams.Apps; |
| 5 | using Microsoft.Teams.Apps.Api.Clients; |
| 6 | using Microsoft.Teams.Apps.Handlers; |
| 7 | using Microsoft.Teams.Core; |
| 8 | using Microsoft.Teams.Core.Hosting; |
| 9 | |
| 10 | namespace CustomHosting; |
| 11 | |
| 12 | public class MyTeamsBotApp : TeamsBotApplication |
| 13 | { |
| 14 | public MyTeamsBotApp(ConversationClient conversationClient, UserTokenClient userTokenClient, ApiClient teamsApiClient, IHttpContextAccessor httpContextAccessor, ILogger<TeamsBotApplication> logger, BotApplicationOptions? options = null) : base(conversationClient, userTokenClient, teamsApiClient, httpContextAccessor, logger, options) |
| 15 | { |
| 16 | this.OnMessage(async (ctx, ct) => |
| 17 | { |
| 18 | await ctx.SendActivityAsync("Hello from MyTeamsBotApp!", ct); |
| 19 | }); |
| 20 | } |
| 21 | } |
| 22 | |