Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Conversation

@Dwigoric
Copy link
Member

@Dwigoric Dwigoric commented Nov 9, 2022

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@Dwigoric Dwigoric self-assigned this Nov 9, 2022
@Dwigoric Dwigoric changed the title TypeScript rewrite and implementation of application commands [WIP] TypeScript rewrite and implementation of application commands Nov 9, 2022
@Dwigoric Dwigoric added enhancement New feature or request help wanted Extra attention is needed labels Nov 9, 2022
@Dwigoric Dwigoric changed the title [WIP] TypeScript rewrite and implementation of application commands [WIP] v4: TypeScript rewrite and implementation of application commands Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants