Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 15 additions & 29 deletions Samples/Samples.BotBuilder/Program.cs
Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Teams.Api.Activities;
using Microsoft.Teams.Apps;
using Microsoft.Teams.Apps.Activities;
using Microsoft.Teams.Apps.Annotations;
using Microsoft.Teams.Apps.Extensions;
using Microsoft.Teams.Plugins.AspNetCore.DevTools.Extensions;
using Microsoft.Teams.Plugins.AspNetCore.Extensions;

namespace Samples.BotBuilder;
using Samples.BotBuilder;
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace directive was removed but the code references Samples.BotBuilder.Bot (via the using statement at line 7). Ensure that the Bot class is defined in the Samples.BotBuilder namespace in another file, otherwise this will cause a compilation error.

Copilot uses AI. Check for mistakes.

public static partial class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTransient<Controller>();
builder
.AddTeams()
.AddTeamsDevTools()
.AddBotBuilder<Bot, BotBuilderAdapter, ConfigurationBotFrameworkAuthentication>();
var builder = WebApplication.CreateBuilder(args);
builder
.AddTeams()
.AddTeamsDevTools()
.AddBotBuilder<Bot, BotBuilderAdapter, ConfigurationBotFrameworkAuthentication>();

var app = builder.Build();

var app = builder.Build();
var teams = app.UseTeams();

app.UseTeams();
app.Run();
}
teams.OnMessage(async context =>
{
await context.Typing();
await context.Send("hi from teams...");
});

[TeamsController]
public class Controller
{
[Message]
public async Task OnMessage([Context] MessageActivity activity, [Context] IContext.Client client, [Context] Microsoft.Teams.Common.Logging.ILogger log)
{
await client.Typing();
await client.Send($"hi from teams...");
}
}
}
app.Run();
Loading