microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/samples/CustomHosting/MyTeamsBotApp.cs
24lines · 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 | |
| 8 | namespace CustomHosting; |
| 9 | |
| 10 | public class MyTeamsBotApp : TeamsBotApplication |
| 11 | { |
| 12 | public MyTeamsBotApp( |
| 13 | ApiClient api, |
| 14 | IHttpContextAccessor accessor, |
| 15 | ILogger<MyTeamsBotApp> logger, |
| 16 | TeamsBotApplicationOptions? options = null) |
| 17 | : base(api, accessor, logger, options) |
| 18 | { |
| 19 | this.OnMessage(async (ctx, ct) => |
| 20 | { |
| 21 | await ctx.SendActivityAsync("Hello from MyTeamsBotApp!", ct); |
| 22 | }); |
| 23 | } |
| 24 | } |
| 25 | |