microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
feature/pabot-httpcontext-botid

Branches

Tags

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

Clone

HTTPS

Download ZIP

core/samples/CustomHosting/MyTeamsBotApp.cs

25lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using Microsoft.AspNetCore.Http;
5using Microsoft.Teams.Apps;
6using Microsoft.Teams.Apps.Api.Clients;
7using Microsoft.Teams.Apps.Handlers;
8
9namespace CustomHosting;
10
11public class MyTeamsBotApp : TeamsBotApplication
12{
13 public MyTeamsBotApp(
14 ApiClient api,
15 IHttpContextAccessor accessor,
16 ILogger<MyTeamsBotApp> logger,
17 TeamsBotApplicationOptions? options = null)
18 : base(api, accessor, logger, options)
19 {
20 this.OnMessage(async (ctx, ct) =>
21 {
22 await ctx.SendActivityAsync("Hello from MyTeamsBotApp!", ct);
23 });
24 }
25}
26