docs(create-discord-bot): support bun in create-discord-bot (#9798)

This commit is contained in:
Colin McDonnell
2023-08-28 00:36:26 -07:00
committed by GitHub
parent 85d03a3000
commit 7157748fe3
13 changed files with 38 additions and 1 deletions

View File

@@ -16,7 +16,14 @@
## About
`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.
It's easy to create a simple Discord bot to begin your journey with the Discord API.
```sh
npm create discord-bot ./your/chosen/directory
yarn create discord-bot ./your/chosen/directory
pnpm create discord-bot ./your/chosen/directory
bunx create-discord-bot ./your/chosen/directory
```
## Links

View File

@@ -31,6 +31,10 @@ export function resolvePackageManager(): PackageManager {
return 'pnpm';
}
if (npmConfigUserAgent.startsWith('bun')) {
return 'bun';
}
console.error(
picocolors.yellow(
`Detected an unsupported package manager (${npmConfigUserAgent}). Falling back to ${DEFAULT_PACKAGE_MANAGER}.`,

View File

@@ -35,6 +35,7 @@ discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to
npm install discord.js
yarn add discord.js
pnpm add discord.js
bun add discord.js
```
### Optional packages
@@ -52,6 +53,7 @@ Install discord.js:
npm install discord.js
yarn add discord.js
pnpm add discord.js
bun add discord.js
```
Register a slash command against the Discord API:

View File

@@ -29,6 +29,7 @@
npm install @discordjs/formatters
yarn add @discordjs/formatters
pnpm add @discordjs/formatters
bun add @discordjs/formatters
```
## Example usage

View File

@@ -22,6 +22,7 @@
npm install @discordjs/next
yarn add @discordjs/next
pnpm add @discordjs/next
bun add @discordjs/next
```
## Links

View File

@@ -29,6 +29,7 @@
npm install @discordjs/proxy
yarn add @discordjs/proxy
pnpm add @discordjs/proxy
bun add @discordjs/proxy
```
## Links

View File

@@ -31,6 +31,7 @@ Note: native fetch (not recommended) is unavailable in this node version, either
npm install @discordjs/rest
yarn add @discordjs/rest
pnpm add @discordjs/rest
bun add @discordjs/rest
```
## Examples
@@ -41,6 +42,7 @@ Install all required dependencies:
npm install @discordjs/rest discord-api-types
yarn add @discordjs/rest discord-api-types
pnpm add @discordjs/rest discord-api-types
bun add @discordjs/rest discord-api-types
```
Send a basic message:

View File

@@ -26,6 +26,7 @@
npm install @discordjs/util
yarn add @discordjs/util
pnpm add @discordjs/util
bun add @discordjs/util
```
## Links

View File

@@ -38,6 +38,7 @@
npm install @discordjs/voice
yarn add @discordjs/voice
pnpm add @discordjs/voice
bun add @discordjs/voice
```
## Dependencies

View File

@@ -29,6 +29,7 @@
npm install @discordjs/ws
yarn add @discordjs/ws
pnpm add @discordjs/ws
bun add @discordjs/ws
```
### Optional packages