# Chat management

Before using chat API, please create chat management object. The methods as follows:

local Chat = class.Chat.new()

The specific function name and description are as follows:

Serial number Function name Description
1 sendChat(...) Send chat message(Default to all players)
2 sendSystemMsg(...) Send system message(Default to all players)

# sendChat

  • Parameters and types:
    • content:string
    • targetuin:numberSend to the player, whose uin is targetuin. 0 means sending to all players.
  • Return value and types:
  • The main role of this method: Send chat message(Default to all players)
  • The specific use cases are as follows:
--Send a chat message
--The first parameter is the message content,the second parameter is the uin of the player receiving the message,0 means all players (seems to have no effect)
Chat:sendChat("This is a chat message!",0)
Chat:sendChat("You can also just enter the message content and send it to all players by default")

# sendSystemMsg

  • Parameters and types:
    • content:string
    • targetuin:numberSend to the player, whose uin is targetuin. 0 means sending to all players.
  • Return value and types:
  • The main role of this method: Send system message(Default to all players)
  • The specific use cases are as follows:
--Send a system message
--The first parameter is the message content,the second parameter is the uin of the player receiving the message,0 means all players (seems to have no effect)
Chat:sendSystemMsg("This is a system message!",0)
Chat:sendSystemMsg("You can also just enter the content of the message and send it to all players by default")
Last Update: 6/11/2020, 9:30:46 PM