Live Chat

Sending your first message

Fields ( "message" )

Fusion::SendMessage("FusionAPI.dev 💙");

Once you have done the above step you will be able to fetch the chat & see all client messages as shown below.

Fetching the chat

Fusion::GetChat();

Below is a example response from GetChat();

[
   {
      "author":[
         "1",
         "Peep"
      ],
      "content":"SuM oF DeM ExAmPlEs FoR dA WrLd.",
      "edited":false,
      "message-id":"ScqQXwXk6jsp9qXzMiMzhrNSp069A9CfB-lTPuSsYC53VnF3sSOyoAYo420RYQwC8Cybxz5tV2pWjpimMALsuAls1H-kgINlSTYDiVusLylDQ5BcGSwsvDzMCx-XVXnjP",
      "timestamp":1621022680
   },
   {
      "author":[
         "2",
         "Fuji"
      ],
      "content":"FusionAPI just 2 good",
      "edited":false,
      "message-id":"vnVpQ7SzQi0SgF1gy-z8Uq3T9QdH2XXXAJoWC54jVMoqCZR1B2sfAI999SCP2jtvro-Y0iv-dydDBNmg3-WQneNvlqmKhkbFOg-tYwejnCYzk-4gzGJ1M4CxxyaF7Mg",
      "timestamp":1621021774
   }
]

"author" containts [ "user-id", "username" ] and the rest of each block contains very clear information you will need to do more in depth stuff with our chat like editing and deleting messages as shown below.

Editing Messages

Fields ( "message-id", "new message" )

Fusion::EditMessage("xphHxeEeekO-b67UkOLywg", "FusionAPI.dev 💙");

Deleting Messages

Fields ( "message-id" )

Fusion::DeleteMessage("xphHxeEeekO-b67UkOLywg");

Last updated