Refactor: Port this project into typescript #58
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this is
During the initial planning phase, this project was planned to be using Python and the
interactions.py
library. However, due to a few hiccups with the libraries, esp. aroundinteractions.py
, we have lost a lot of morale in the project. Time was spent mostly on fixing the bugs with the tools and not creating a meaningful experience.This is why I took the time to make a porting attempt of this project into TypeScript, using the bootstrapping template at
samhwang/ts-starter-template
and a similar structure toviet-aus-it/vait-discord-bot
.Why this PR was made
The decision was made on a few key points:
discord.js
library is more actively maintained thaninteractions.py
discord.js
is a lot more detailed in what we need to do in deploying guild-specific things vs global. This was severely lacking ininteractions.py
.Caveats
However, this decision also comes with caveats:
gdown
, so I had to write up a module manually.What was done
vitest
Test runnertsup
TypeScript Bundlertsx
CLI tool to run TypeScript files locallybiome
Linter & Formatterzod
Schema validationsrc/discord_bot
is now split up into 3:src/discord
for discord related utilitiessrc/slash-commands
for all slash commandssrc/autocompletes
for all autocompletesI understand this PR maybe wieldy to look at in just the changed files. Please take a look at the branch as a whole.