microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.1.0-preview-0007

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

core/samples/CustomHosting/MyTeamsBotApp.cs

24lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.Apps;
5using Microsoft.Teams.Apps.Api.Clients;
6using Microsoft.Teams.Apps.Handlers;
7
8namespace CustomHosting;
9
10public 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