Element-0 / ElementZero

Run windows version of BDS in linux with Mod support
GNU General Public License v3.0
272 stars 51 forks source link

ChatAPI bug for content variable #71

Closed TetsuyaGR closed 4 years ago

TetsuyaGR commented 4 years ago

When i try print the content (for debugging) with the onChat event i always get "undefined". Here's my code

import { onChat, sendBroadcast } from "ez:chat"; onChat((sender, content) => { console.log("ok works"); console.log(content); console.log(sender); console.log(typeof(content)); });

SacriGrape commented 4 years ago

onChat doesn't make two different objects (content, sender), it makes one.

TetsuyaGR commented 4 years ago

Aw yeah i understand that now it seems i have to do wrap["sender"] and wrap["content"] and to put only 1 parameter onChat