This repository was archived by the owner on Feb 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] v4: TypeScript rewrite and implementation of application commands #16
Open
Dwigoric
wants to merge
29
commits into
main
Choose a base branch
from
v4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 5ddbccd.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
This PR rewrites Stalwartle code into TypeScript and implements application commands, in addition to the already-present message-run commands. Additionally, the current Lavalink API wrapper has been deprecated, thus migration to Lavacoffee will be implemented.
Motivation and Context
TypeScript Rewrite
The usage of TypeScript for a feature-rich Discord chatbot such as Stalwartle reduces runtime errors. Many common runtime errors are caused by JavaScript's dynamically typed nature. Therefore variable types are mostly unknown especially when dealing with a project of multiple files, such as Stalwartle. Moreover, TypeScript is more efficient compared to JavaScript. Although JavaScript is very popular, it is the slowest language that takes a lot of time to execute commands. These are just among the many reasons for migrating to TypeScript from JavaScript.
Application Commands
Discord bot development has seen the rise of bots using application commands. Although Stalwartle is already approved for message intents, using application commands shall reduce app load since Discord will parse the arguments to commands, among other benefits. The implementation of application commands also opens the opportunity to integrate Stalwartle more into Discord, making it easy for the users to use Stalwartle.
Lavacoffee
Lavacoffee has a similar structure to erela.js. Migrating to Lavacoffee should only require a bit of source code modification.
How Has This Been Tested?
Due to the immaturity of this PR, I have not tested it yet.
Types of changes
Checklist: