Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
53c1efe
feat: bun related docs (@stonega)
MasedMSD Oct 1, 2024
3b659a4
Merge branch 'main' into bun-docs
KnorpelSenf Oct 15, 2024
0af69fa
Merge branch 'main' into bun-docs
KnorpelSenf Oct 15, 2024
fe5473b
Changed `index.ts` to `bot.ts`
MasedMSD Oct 16, 2024
378f672
Fixed instruction in guide/introduction.md
MasedMSD Oct 16, 2024
6da79ae
fixed lint and fmt
MasedMSD Oct 16, 2024
44e7fe2
fix bad indentation
KnorpelSenf Oct 16, 2024
bd2f6fd
Merge branch 'main' into bun-docs
LWJerri Nov 4, 2024
17acb0d
Merge branch 'main' into bun-docs
KnorpelSenf Nov 6, 2024
7bd73c7
Apply suggestions from code review
MasedMSD Nov 6, 2024
3106c3b
Init Typescript config
MasedMSD Nov 6, 2024
eb62f5b
Merge branch 'main' into bun-docs
MasedMSD Nov 6, 2024
f77d821
Merge branch 'main' into bun-docs
MasedMSD Nov 17, 2024
2b7d73b
Merge branch 'main' into bun-docs
KnorpelSenf Nov 20, 2024
28af369
Mention support of BunFile
MasedMSD Nov 21, 2024
1900f63
Merge branch 'main' into bun-docs
KnorpelSenf Nov 21, 2024
ac40ea0
Merge branch 'main' into bun-docs
MasedMSD Jan 16, 2025
c5ed710
Merge branch 'main' into bun-docs
LWJerri Jan 27, 2025
4c27314
Merge branch 'main' into bun-docs
LWJerri Feb 17, 2025
0441dff
Merge branch 'main' into bun-docs
LWJerri Apr 12, 2025
4c51b10
Merge branch 'main' into bun-docs
LWJerri Apr 19, 2025
6d19e4c
Merge branch 'main' into bun-docs
LWJerri May 5, 2025
9fc82a1
Merge branch 'main' into bun-docs
LWJerri Jul 17, 2025
38d4ac8
Merge branch 'main' into bun-docs
LWJerri Aug 23, 2025
b437df3
Merge branch 'main' into bun-docs
LWJerri Sep 3, 2025
bef05f4
Merge branch 'main' into bun-docs
LWJerri Sep 12, 2025
0cad7d3
Merge branch 'main' into bun-docs
LWJerri Oct 12, 2025
3d6240a
Merge branch 'main' into bun-docs
LWJerri Nov 7, 2025
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
24 changes: 23 additions & 1 deletion site/docs/guide/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,20 @@ new InputFile("/path/to/file");
new InputFile(await Deno.open("/path/to/file"));
```

```ts [Bun]
// Send a local file.
new InputFile("/path/to/file");

// Send a `BunFile` instance.
new InputFile(await Bun.file("/path/to/file").bytes());
```

:::

#### Uploading Raw Binary Data

You can also send a `Buffer` object, or an iterator that yields `Buffer` objects.
On Deno, you can send `Blob` objects, too.
On Deno and Bun you can send `Blob` objects, too.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
On Deno and Bun you can send `Blob` objects, too.
On Deno and Bun, you can send `Blob` objects, too.


::: code-group

Expand Down Expand Up @@ -215,6 +223,20 @@ new InputFile(function* () {
});
```

```ts [Bun]
// Send a blob.
const blob = new Blob("ABC", { type: "text/plain" });
new InputFile(blob);
// Send a buffer or a byte array.
const buffer = Uint8Array.from([65, 66, 67]);
new InputFile(buffer); // "ABC"
// Send an iterable.
new InputFile(function* () {
// "ABCABCABCABC"
for (let i = 0; i < 4; i++) yield buffer;
});
```

:::

#### Downloading and Reuploading a File
Expand Down
Loading