refactor: message.content always returns a string (#72)

Not to sure but this could be a simple fix for system messages having "no message content".

Everytime someone uses the `client.on("message",...)` function they have to include a check if `message.content` even exists when wanting to work with `message.content` since if you don't the program breaks every time it recieves a system message, which returns a message with undefined content. In my opinion making `message.content` always return a string is a better alternative to undefined. It would make using revolt.js more convenient for most of the developers.
This commit is contained in:
lalo
2023-08-25 16:50:22 +02:00
committed by GitHub
parent 8600417a71
commit 4f4b153360
+1 -1
View File
@@ -113,7 +113,7 @@ export class Message {
* Content
*/
get content() {
return this.#collection.getUnderlyingObject(this.id).content;
return this.#collection.getUnderlyingObject(this.id).content ?? "";
}
/**