Skip to content

Conversation

@milanholemans
Copy link
Contributor

Closes #6483

Copilot AI review requested due to automatic review settings December 30, 2025 18:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the teams chat message send command by adding support for specifying the content type of chat messages. Users can now send messages as either plain text or HTML formatted content.

  • Adds a new optional --contentType parameter accepting 'text' or 'html' values
  • Updates telemetry tracking to include the contentType option
  • Refactors test setup to eliminate duplicate stub configurations

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/m365/teams/commands/chat/chat-message-send.ts Adds contentType option with validation, imports Auth class, modifies API request to include contentType in body, and updates access token retrieval
src/m365/teams/commands/chat/chat-message-send.spec.ts Consolidates test setup by moving prompt setting stub to before hook, adds validation test for invalid contentType, adds test for HTML content type functionality
src/m365/teams/commands/chat/chatUtil.ts Fixes spacing in comment documentation (emailaddresses → email addresses)
docs/docs/cmd/teams/chat/chat-message-send.mdx Adds contentType option documentation, includes permissions table with delegated and application permission details, updates example to demonstrate HTML content type usage

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/m365/teams/commands/chat/chat-message-send.spec.ts:245

  • The validation test for invalid contentType values is present, but there's no corresponding test to verify that valid contentType values ('text' and 'html') pass validation. Consider adding a test case similar to the existing validation tests that verifies contentType validation succeeds with valid values.
  it('fails validation if contentType is not valid', async () => {
    const actual = await command.validate({
      options: {
        chatId: '19:8b081ef6-4792-4def-b2c9-c363a1bf41d5_5031bb31-22c0-4f6f-9f73-91d34ab2b32d@unq.gbl.spaces',
        contentType: 'Invalid',
        message: 'Hello World'
      }
    }, commandInfo);
    assert.notStrictEqual(actual, true);
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for HTML messages using teams chat message send

1 participant