Skip to content

Commit 7157748

Browse files
authored
docs(create-discord-bot): support bun in create-discord-bot (#9798)
1 parent 85d03a3 commit 7157748

File tree

13 files changed

+38
-1
lines changed

13 files changed

+38
-1
lines changed

Diff for: apps/guide/src/content/02-installations-and-preparations/01-installing-node-discordjs.mdx

+8
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ yarn init
6767
pnpm init; pnpm pkg set type="module"
6868
```
6969

70+
```sh bun
71+
bun init
72+
```
73+
7074
</CH.Code>
7175

7276
This is the next command you'll be running. This command creates a _`package.json`_ file for you, which will keep track of the dependencies your project uses, as well as other info.
@@ -93,6 +97,10 @@ yarn add discord.js
9397
pnpm add discord.js
9498
```
9599

100+
```sh bun
101+
bun add discord.js
102+
```
103+
96104
</CH.Code>
97105

98106
And that's it! With all the necessities installed, you're almost ready to start coding your bot.

Diff for: apps/guide/src/content/03-creating-your-bot/01-configuration-files.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ yarn add dotenv
7777
pnpm add dotenv
7878
```
7979

80+
```sh bun
81+
# Bun automatically reads .env files
82+
```
83+
8084
</CH.Code>
8185

8286
<CH.Code lineNumbers={false} rows={7}>

Diff for: apps/guide/src/content/05-additional-info/03-updating-to-v14.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ yarn remove @discordjs/builders @discordjs/formatters @discordjs/rest discord-ap
2727
pnpm remove @discordjs/builders @discordjs/formatters @discordjs/rest discord-api-types
2828
```
2929

30+
```sh bun
31+
bun remove @discordjs/builders @discordjs/formatters @discordjs/rest discord-api-types
32+
```
33+
3034
</CH.Code>
3135

3236
## Breaking Changes

Diff for: packages/create-discord-bot/README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@
1616

1717
## About
1818

19-
`npx create-discord-bot ./your/chosen/directory/`. It's as easy as that to create a simple Discord bot to begin your journey with the Discord API.
19+
It's easy to create a simple Discord bot to begin your journey with the Discord API.
20+
21+
```sh
22+
npm create discord-bot ./your/chosen/directory
23+
yarn create discord-bot ./your/chosen/directory
24+
pnpm create discord-bot ./your/chosen/directory
25+
bunx create-discord-bot ./your/chosen/directory
26+
```
2027

2128
## Links
2229

Diff for: packages/create-discord-bot/src/helpers/packageManager.ts

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ export function resolvePackageManager(): PackageManager {
3131
return 'pnpm';
3232
}
3333

34+
if (npmConfigUserAgent.startsWith('bun')) {
35+
return 'bun';
36+
}
37+
3438
console.error(
3539
picocolors.yellow(
3640
`Detected an unsupported package manager (${npmConfigUserAgent}). Falling back to ${DEFAULT_PACKAGE_MANAGER}.`,

Diff for: packages/discord.js/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to
3535
npm install discord.js
3636
yarn add discord.js
3737
pnpm add discord.js
38+
bun add discord.js
3839
```
3940

4041
### Optional packages
@@ -52,6 +53,7 @@ Install discord.js:
5253
npm install discord.js
5354
yarn add discord.js
5455
pnpm add discord.js
56+
bun add discord.js
5557
```
5658

5759
Register a slash command against the Discord API:

Diff for: packages/formatters/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
npm install @discordjs/formatters
3030
yarn add @discordjs/formatters
3131
pnpm add @discordjs/formatters
32+
bun add @discordjs/formatters
3233
```
3334

3435
## Example usage

Diff for: packages/next/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
npm install @discordjs/next
2323
yarn add @discordjs/next
2424
pnpm add @discordjs/next
25+
bun add @discordjs/next
2526
```
2627

2728
## Links

Diff for: packages/proxy/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
npm install @discordjs/proxy
3030
yarn add @discordjs/proxy
3131
pnpm add @discordjs/proxy
32+
bun add @discordjs/proxy
3233
```
3334

3435
## Links

Diff for: packages/rest/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Note: native fetch (not recommended) is unavailable in this node version, either
3131
npm install @discordjs/rest
3232
yarn add @discordjs/rest
3333
pnpm add @discordjs/rest
34+
bun add @discordjs/rest
3435
```
3536

3637
## Examples
@@ -41,6 +42,7 @@ Install all required dependencies:
4142
npm install @discordjs/rest discord-api-types
4243
yarn add @discordjs/rest discord-api-types
4344
pnpm add @discordjs/rest discord-api-types
45+
bun add @discordjs/rest discord-api-types
4446
```
4547

4648
Send a basic message:

Diff for: packages/util/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
npm install @discordjs/util
2727
yarn add @discordjs/util
2828
pnpm add @discordjs/util
29+
bun add @discordjs/util
2930
```
3031

3132
## Links

Diff for: packages/voice/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
npm install @discordjs/voice
3939
yarn add @discordjs/voice
4040
pnpm add @discordjs/voice
41+
bun add @discordjs/voice
4142
```
4243

4344
## Dependencies

Diff for: packages/ws/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
npm install @discordjs/ws
3030
yarn add @discordjs/ws
3131
pnpm add @discordjs/ws
32+
bun add @discordjs/ws
3233
```
3334

3435
### Optional packages

0 commit comments

Comments
 (0)