Matthias
  • 👋Welcome
  • 👶Getting started
  • 📞Callbacks
  • 🕑Variables
    • 🎯Getter functions
      • 🙏Fields available for getting
  • 🧑‍🦯Visuals
    • ◻️Shapes
      • 📏Line
      • ⚪Circle
      • ⬜Rectangle
    • 📸Media
      • 🖼️Image
      • 🔡Text
    • 🔔Notifications
  • ☁️Miscellaneous
    • 📲Image memory management
Powered by GitBook
On this page

Callbacks

Callbacks are really important in an API, as they provide flexibility and customization to an extension.

PreviousGetting startedNextGetter functions

The list of callbacks you can use, with the trigger of their call as well as what argument does the callback come with:

  • OnChatSend (Called when a chat is sent) Argument: The message sent by the user (Only text messages are provided in the argument, this does not mean that it is not called when sending a file.)

  • OnChatReceive (Called when a chat is received) Argument: The message received serialized

  • OnServerChatReceive (This is unused and reserved for something else in the future)

  • OnCallSend (Called when the user joins a call)

  • OnCallReceive (Called when there is a call started)

  • OnDraw (Called every frame)

  • OnConnect (Called when connecting to a server) Argument: The address the user is connecting to.

  • OnDisconnect (Called when disconnecting from a server)

Please note that function arguments are "optional" that means if one does not wish to get them they can format their function accordingly.

Example:

function OnChatSend(message)
     --Do anything with the message
end
function OnChatSend()
     --The function will still be called
end
📞
Serde