fix(message) retrieve message method
This commit is contained in:
@@ -17,7 +17,7 @@ export default class Message {
|
|||||||
this.#message = this.#data.message;
|
this.#message = this.#data.message;
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
this.#data = undefined;
|
this.#data = undefined;
|
||||||
this.#message = undefined;
|
this.#message = rawText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,4 +40,12 @@ export default class Message {
|
|||||||
get(key) {
|
get(key) {
|
||||||
return this.#data[key];
|
return this.#data[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the text content.
|
||||||
|
* @returns {string} - the text content of the socket message;
|
||||||
|
*/
|
||||||
|
text() {
|
||||||
|
return this.#data.message || '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user