CREATE YOUR WORLD
Chat
QuickChat
5min
quickmessage related functions in the zepetoworldcontent api can be used to implement the ability to send and receive messages within the world this feature is available in a world where multiplayer elements are implemented in order to use quickmessage functions, you must create an import statement as follows import { zepetoworldcontent, worldmultiplaychatcontent, quickmessage } from 'zepeto world'; zepetoworldcontent api provides the following quickmessage related functions api description zepetoworldcontent getquickmessagelist($oncomplete system action$1\<quickmessage\[]>, $onerror system action$1) import the quickmessage list for the current world (import which corresponds to the language of the device ) it can be used as the code shown below zepetoworldcontent getquickmessagelist(quickmessagelist quickmessage\[] => { // handling quickmessage }, err => { }); worldmultiplaychatcontent api enables quickmessage synchronization in multi player when using the functions below, a chat message is sent and output in the chat window in addition, if you enable bubblechat in zepetoplayers, you can see that a speech bubble pops up in the app api description sendquickmessage($quickid string)\ void; sends a quickid message entered to the multi player server ❗️ caution if the value of the quickid is different from the existing quickmessage list, it will not be sent quickmessage class consists of the following components class quickmessage extends system object { public id string; public message string; } the following is an entire example code that uses functions of quickmessage features import { button } from 'unityengine ui'; import { zepetoscriptbehaviour } from 'zepeto script'; import { zepetoworldcontent, worldmultiplaychatcontent, quickmessage } from 'zepeto world'; export default class quickchat extends zepetoscriptbehaviour { public quickchatbtn button; start() { zepetoworldcontent getquickmessagelist(quickmessagelist => { quickmessagelist foreach((quickmessage quickmessage, index number, array quickmessage\[]) => { console log(`id = ${quickmessage id}, message = ${quickmessage message}`); }); }, err => { console log(`quickmessage error ${err}`); }); // send "hi" message this quickchatbtn onclick addlistener(() => { this onclickquickmessagebutton("zw quickchat preset 001"); }); } private onclickquickmessagebutton(quickid string) { worldmultiplaychatcontent instance sendquickmessage(quickid); } }