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