notherbase-fs 3.3.10 → 3.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "3.3.10",
3
+ "version": "3.3.11",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
@@ -71,8 +71,15 @@ class ChatBox {
71
71
  /**
72
72
  * Sends a new chat message to the server.
73
73
  */
74
- sendMessage = () => {
75
- if (this.$entry.val() !== ""){
74
+ sendMessage = (override = null) => {
75
+ if (override !== null) {
76
+ this.socket.emit('chat message', {
77
+ name: this.username,
78
+ time: Date.now(),
79
+ text: override
80
+ });
81
+ }
82
+ else if (this.$entry.val() !== ""){
76
83
  let val = this.$entry.val();
77
84
  this.$entry.val("");
78
85
 
@@ -25,4 +25,6 @@
25
25
  let chatTest = new ChatBox("<%= user.username %>", "test-chat");
26
26
  let chatTest2 = new ChatBox("<%= user.username %>", "test-chat-2");
27
27
  let chatTest3 = new ChatBox("<%= user.username %>", "test-chat-3");
28
+
29
+ chatTest.sendMessage("Hello, world!");
28
30
  </script>