microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
6594a29aa91c928c547a8821d305758bc8d340ed

Branches

Tags

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

Clone

HTTPS

Download ZIP

core/samples/CustomHosting/MyTeamsBotApp.cs

21lines · 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;
7using Microsoft.Teams.Core;
8using Microsoft.Teams.Core.Hosting;
9
10namespace CustomHosting;
11
12public 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