discord.js
discord.js copied to clipboard
feat(create-discord-bot): Add prompts, command handler and deployment script
Please describe the changes this PR makes and why it should be merged:
In addition to the titular changes, this uses top level await in the script where applicable.
- Closes GDE-82
- Closes GDE-83
- Closes GDE-85
- Closes GDE-86
🤖 Generated by Copilot at 18c3c4c
- Simplify the package structure and remove the need for TypeScript compilation by replacing the
create-discord-bot.ts
file with thecreate-discord-bot.js
file (link) - Export a function to create a discord bot based on the user's input from the
index.ts
file, which uses thecommander
andprompts
packages to parse the command-line arguments and ask for the user's preferences (link) - Change the
bin
field in thepackage.json
file to point to theindex.mjs
file instead of thecreate-discord-bot.mjs
file, which was removed (link) - Add the
prompts
and@types/prompts
dependencies to thepackage.json
file to interact with the user and provide TypeScript type definitions (link, link) - A
.env
file to store the application ID of the discord bot, which is needed to register the commands (link, link) - A
deploy
script and a@discordjs/core
dependency in thepackage.json
file to register the commands to the discord API and provide HTTP methods and types (link, link) - A
commands
directory with anindex.js
orindex.ts
file to define the type and predicate for the commands, and aping.js
orping.ts
file to define and export a simple ping command (link, link, link, link) - An
events
directory with anindex.js
orindex.ts
file to define the type and predicate for the events, and aready.js
file to define and export a simple ready event (link, link, link) - A
util
directory with adeploy.js
file to load the commands and register them to the discord API, aloaders.js
orloaders.ts
file to load and validate the commands and events, and aregisterEvents.js
orregisterEvents.ts
file to register the event handlers for the commands and events to the client (link, link, link) - A
src/index.js
orsrc/index.ts
file to use theloaders.js
orloaders.ts
andregisterEvents.js
orregisterEvents.ts
files to load and register the commands and events (link, link) - Disable the
jsdoc
linting for the commands and events in the.eslintrc.json
file in the JavaScript template, as it was causing some errors and warnings for the types and tags used (link)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
why is there javascript
variable
we are checking only typescript
so some conversion should be done
I'm getting some errors picked up by ESLint in the template directory, but the lint script does not check that. Should that be tweaked?
Codecov Report
Merging #9570 (38165fb) into main (20268ac) will increase coverage by
0.10%
. The diff coverage isn/a
.
:exclamation: Current head 38165fb differs from pull request most recent head 7fa1865. Consider uploading reports for the commit 7fa1865 to get more accurate results
@@ Coverage Diff @@
## main #9570 +/- ##
==========================================
+ Coverage 58.06% 58.17% +0.10%
==========================================
Files 227 227
Lines 14948 14891 -57
Branches 1131 1130 -1
==========================================
- Hits 8680 8663 -17
+ Misses 6228 6188 -40
Partials 40 40
Flag | Coverage Δ | |
---|---|---|
brokers | 63.16% <ø> (ø) |
|
builders | 98.69% <ø> (ø) |
|
collection | 99.87% <ø> (ø) |
|
guide | 0.00% <ø> (ø) |
|
proxy | 76.31% <ø> (ø) |
|
rest | 93.18% <ø> (+0.25%) |
:arrow_up: |
util | 98.49% <ø> (ø) |
|
utilities | 100.00% <ø> (ø) |
|
voice | 63.47% <ø> (ø) |
|
website | 0.00% <ø> (ø) |
|
ws | 53.88% <ø> (+0.94%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
see 8 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more