[TS]: Create Bot File Upload Basic Sample #1884
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request creates a new TypeScript bot file upload sample using the modern Teams SDK (@microsoft/teams.apps), replacing the old JavaScript implementation that used Bot Framework v4.
Changes:
- Removes the old Bot Framework v4-based JavaScript implementation
- Adds a new TypeScript sample using
@microsoft/teams.appsSDK - Updates sample metadata and documentation
Reviewed changes
Copilot reviewed 35 out of 46 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/bot-file-upload/nodejs/bot-file-upload/index.ts | New TypeScript implementation with Teams SDK handlers for file upload/download |
| samples/bot-file-upload/nodejs/bot-file-upload/package.json | New package configuration for TypeScript sample |
| samples/bot-file-upload/nodejs/bot-file-upload/README.md | Documentation for the new TypeScript sample |
| samples/bot-file-upload/nodejs/bot-file-upload/assets/sample.json | Updated sample metadata |
| samples/bot-file-upload/nodejs/bot-file-upload/.env | Environment configuration template |
| samples/bot-file-upload/nodejs/* (deleted files) | Removed old Bot Framework v4 implementation and configuration |
Comments suppressed due to low confidence (1)
samples/bot-file-upload/nodejs/bot-file-upload/assets/sample.json:12
- The creationDateTime and updateDateTime are set to future dates (2026-01-28). According to the internal knowledge, the current date is January 29, 2026, but setting the creationDateTime to 2026-01-28 for a new sample is problematic. The creationDateTime should reflect when the sample was originally created or use a realistic past date.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
we still want to keep the bot-file-upload sample- we'll move it into an archived folder
| "title": "Bot File Upload", | ||
| "shortDescription": "This bot sample for Teams demonstrates file upload capabilities using Bot Framework v4, enabling users to upload files and view inline images within chats.", | ||
| "url": "https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-file-upload/nodejs", | ||
| "title": "Bot Cards", |
There was a problem hiding this comment.
nit: Bot Cards and Attaachments
| "url": "https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-file-upload/nodejs/Images/FileUpload.gif", | ||
| "alt": "Solution UX showing file upload using bot" | ||
| "url": "https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/bot-cards/bot-cards.gif", | ||
| "alt": "Solution UX showing various card types and actions in bot" |
There was a problem hiding this comment.
various card types, actions, and attachments
| @@ -0,0 +1,28 @@ | |||
| # Bot Cards - Node.js (TypeScript) | |||
There was a problem hiding this comment.
nit: Bot Quickstart - TypeScript
| @@ -0,0 +1,28 @@ | |||
| # Bot Cards - Node.js (TypeScript) | |||
|
|
|||
| This sample demonstrates various card types and actions for Microsoft Teams using Node.js and TypeScript. | |||
There was a problem hiding this comment.
various card types, actions, and attachments
| await sendToggleVisibilityCard(context); | ||
| } | ||
| // Handle color input | ||
| else if (normalizedText.includes('red')) { |
There was a problem hiding this comment.
can completely remove the colour input logic
| await context.send(`<b>${file.name}</b> received and saved.`); | ||
| } catch (error: any) { | ||
| console.error('Error downloading file:', error); | ||
| await context.send(`Error downloading file: ${error.message}`); |
There was a problem hiding this comment.
lets not send again upon an error
| }); | ||
| } catch (error: any) { | ||
| console.error('Error sending file card:', error); | ||
| await context.send(`Error sending file card: ${error.message}`); |
| }); | ||
| } catch (error: any) { | ||
| console.error('Error processing inline image:', error); | ||
| await context.send(`Error processing image: ${error.message}`); |
|
|
||
| const FILES_DIR = 'files'; | ||
| const app = new App(); | ||
|
|
There was a problem hiding this comment.
this file is very large and messy. can we somehow isolate the logic into different files:
- handling the file uploading + attachments
- handling the suggested actions
- handling the cards
No description provided.