#create-discord-bot

479 messages · Page 1 of 1 (latest)

tepid vineBOT
tepid vineBOT
#

Which application or package is this feature request for?

create-discord-bot

Feature

I really like the progress so far with this package, but there are a few things I'd like to request to do with the TypeScript template:

  1. It would be a good idea for the tool to not install the packages automatically so the user can install them whenever they want.

  2. Upon running the command using the TypeScript template, and waiting for everything to install. It shows this error [here](ht...

tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Description:

Hey!

This pull request aims to enhance the project configuration process and make it more user-friendly and enjoyable.

Changes Made:

  • Implemented a guided prompt system using the @clack/prompts library to provide users with a smoother and more intuitive project setup experience.
  • Improved the style of messages displayed during the project configuration.

Testing:

Manually tested the project setup process, ensuring that the prompts fun...

tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Which package is this bug report for?

create-discord-bot

Issue description

Seems like create-discord-bot is not working properly and esling is being configured wrong from my understanding.
What I did:
Installed the eslint extension.
npx create-discord-bot . and installed the typescript version
I then get in vscode the following:
Missing file extension "ts" for "./util/loaders.js" for all the imports

Code sample

No response

Versions

Everything is latest versio...

tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Which package is this bug report for?

create-discord-bot

Issue description

Steps

  1. Do yarn create discord-bot.
  2. In options use typescript.
  3. In src/util/deploy.ts, error occurs.

Argument of type 'import("(location of bot code)/node_modules/@discordjs/rest/dist/index").REST' is not assignable to parameter of type 'import("(location of bot code)/node_modules/@discordjs/rest/dist/index", { assert: { "resolution-mode": "import" } }).REST'.
Property '#private' in type...

tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

…to address type checking issues

Please describe the changes this PR makes and why it should be merged:
This PR updates the tsconfig.json file by enabling strictNullChecks, noEmit, and allowImportingTsExtensions options. These changes improve the type checking process by ensuring that null and undefined values are handled correctly, preventing type-related runtime errors. Furthermore, the noEmit option is set to true to enable type-checking without compiling the code, suitab...

tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Please describe the changes this PR makes and why it should be merged:
The typescript build was failing for bots created under node.js due to the usage of .ts imports

ESLint was also failing due to the strictNullChecks tsconfig option not being enabled

After fixing the build, prettier was formatting the files in the dist folder

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
tepid vineBOT
tepid vineBOT
#

Which package is this bug report for?

create-discord-bot

Issue description

  1. Run npx create-discord-bot, electing to use TypeScript
  2. Allow the bot to set up the template in a directory
  3. cd into the directory
  4. npm run build

Error reproduces on step 5.

Code sample

No response

Versions

  • discord.js 14.16.0
  • @discordjs/core 1.2.0
  • Node.js 20.11.0
  • TypeScript 5.5.4
  • MacOS Sequoia 15.2

Issue priority

Medium (should be fixed soon)

Which ...

tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Which package is this bug report for?

create-discord-bot

Issue description

Steps to reproduce:

  1. Run npm create discord-bot
  2. Select JavaScript template
  3. Create folder named utility in the commands folder.
  4. Add user command in the utility subdirectory

./commands/utility/user.js

/** @type {import('../index').Command} */
export default {
	data: {
		name: 'user',
		description: 'Provides information about the user.',
	},
	async execute(interaction) {
		await intera...
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Please describe the changes this PR makes and why it should be merged:

New release, new template bumps

One of these days we should really make these replacers that happen when the template gets dropped in the file system (and move deno to import mappings >.>)

Status and versioning classification:

  • I know how to update typings and have done so, or typings don't need updating
  • This PR only includes non-code changes, like changes to documentation, README, etc.
tepid vineBOT
#

Please describe the changes this PR makes and why it should be merged:

Bumps create-discord-bot (and create-discord-app) to 4.0.0 for consistency (discord-app is at 3.1.0 right now, while discord-bot is at 1.x)

Also adds in a CI step for the multi-deploy, but might not be ideal, @iCrawl would love thoughts

Status and versioning classification:

  • This PR only includes non-code changes, like changes to documentation, README, etc.
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Please describe the changes this PR makes and why it should be merged:
The target node version being set to 22.12.0 allows create-discord-bot to become a lot smaller in terms of dependency count:

tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#
  • Add deno detection to the default package manager option
  • Use import attributes instead of the deprecated import assertions
  • Updated the deno template to use the imports option, to avoid including the version of packages in every import
    • This simplifies dependency updates
  • Updated TypeScript templates to use descriptive type parameter names
  • Rewrote the loadStructures function to use the glob function from node:fs/promises
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#
  • Adapted the TypeScript template for native ts support on Node.js
  • Added the templates to the pnpm-workspace on this repository, to ease dependency management
    • This means the templates had to have unique and valid names, so I had to refactor the logic on the package a bit
  • Removed tamasfe.even-better-toml from the recommended dependencies, because it seems completely random?
  • Added pnpm-lock.yaml to .prettierignore
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Pull request overview

This PR modernizes the TypeScript templates to leverage Node.js's native TypeScript execution, eliminating the need for a build step. The templates are also integrated into the pnpm workspace for better dependency management, requiring unique package names. Additionally, an unrelated VS Code extension recommendation has been removed, and pnpm-lock.yaml is now excluded from Prettier formatting.

  • Removed TypeScript transpilation requirement by using .ts file extens...
#

The module and moduleResolution options are set to "NodeNext", but for Bun projects, "Bundler" resolution is more appropriate. Bun has its own module resolution algorithm that differs from Node.js, and "Bundler" mode is designed for bundlers and runtimes like Bun.

Consider changing:

"module": "NodeNext",
"moduleResolution": "NodeNext",

to:

"module": "ESNext",
"moduleResolution": "Bundler",
		"module": "ESNext",
		"moduleResolution": "Bundler",
#

Empty placeholder file contains only export {};. This appears to be a minimal placeholder to make the file a valid TypeScript module, but it doesn't implement any actual bot functionality. This should either be removed or replaced with actual implementation code before release.

Consider either:

  1. Implementing the actual bot initialization code (similar to the Node.js TypeScript template at packages/create-discord-bot/template/TypeScript/src/index.ts)
  2. Removing this file if it's not ne...
#

Missing erasableSyntaxOnly compiler option. The TypeScript template includes "erasableSyntaxOnly": true in its tsconfig.json (line 6), but this Bun TypeScript template doesn't. Since both templates are meant to support native TypeScript execution, they should have consistent compiler options.

Add the missing option:

"compilerOptions": {
	"allowImportingTsExtensions": true,
	"erasableSyntaxOnly": true,
	"declaration": false,
	// ...
}
		"allowImportingTsExtensi...
#

Empty placeholder file contains only console.log() without any arguments. This will output undefined to the console. This appears to be a placeholder that should either be removed or replaced with actual implementation code before release, or at minimum should log a meaningful message.

Consider either:

  1. Implementing the actual bot initialization code (similar to other templates)
  2. Removing this file if it's not needed
  3. Adding a meaningful placeholder message: `console.log('Bot start...
tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Closes #11346

This PR implements Bun templates for the create-discord-bot package:

  • Added TypeScript Bun template with complete src structure and configuration
  • Added JavaScript Bun template with complete src structure and configuration
  • Both templates mirror the Node.js versions with Bun-specific configuration

The templates include:

  • src/index.ts / src/index.js - Main bot entry point
  • src/util/deploy.ts / src/util/deploy.js - Command deployment utility
  • `package...
tepid vineBOT
#

Summary

Implements complete Bun templates for create-discord-bot, both TypeScript and JavaScript versions.

  • TypeScript template (template/Bun/TypeScript/)
  • JavaScript template (template/Bun/JavaScript/)

Each template includes:

  • src/index.{ts,js} - Main entry point using Bun.env
  • src/commands/ - Command structure with ping and user commands
  • src/events/ - Event handlers (ready, interactionCreate)
  • src/util/loaders.{ts,js} - File loader using Bun.Glob and `Bu...
tepid vineBOT
#

This pull request allows the template to be created inside empty git repositories. This is done by checking if the file list only includes .git. The main reasoning for this pr is to allow the command to be easily used on new repositories that were created on GitHub for example. If the empty git repository is detected, a .gitignore is also created for convivence.

Note: The error can actually be by bypassed by adding a file named .git. However, I am not sure if logic checking for ...

tepid vineBOT
tepid vineBOT
#

We should just use the isFolderEmpty helper from the create-next-app package.

https://github.com/vercel/next.js/blob/7fb2aa908216fb3a910c7fa6d24524412b5af6e5/packages/create-next-app/helpers/is-folder-empty.ts#L6

We'd need to ensure their license is included in the file

I've implemented your requested change; however, I wasn't really sure how to go about adding a .gitignore. Should we include a .gitignore for each template instead? Or just avoid creating one altogether.

tepid vineBOT
tepid vineBOT
tepid vineBOT
tepid vineBOT
#

Summary

Implements the Bun templates for create-discord-bot, addressing issue #11346.

This PR adds complete TypeScript and JavaScript templates for Bun that mirror the existing Node.js templates with Bun-specific optimizations:

Key Changes

  • Bun.env instead of process.env for environment variables (idiomatic Bun)
  • Bun.Glob for file pattern matching (better performance than node:fs/promises glob)
  • oven.bun-vscode added to recommended VS Code extensions
  • **npm.pa...
tepid vineBOT
#

Response to CodeRabbit Review Comments

Thank you for the thorough review! I've analyzed all 14 suggestions and want to address them:

Maintaining Consistency with Existing Templates

The Bun templates in this PR intentionally mirror the patterns used in the existing Node.js templates in this same monorepo. This ensures:

  • Consistent behavior across all runtime options
  • Easier maintenance (same patterns = same fixes)
  • Familiar structure for users switching between runtimes

...