microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
samples/migration-bot

Branches

Tags

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

Clone

HTTPS

Download ZIP

core/samples/CustomHosting/MyTeamsBotApp.cs

20lines · modecode

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