# 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:
--发送一条聊天消息
--第一个参数是消息内容,第二个参数是接收消息的玩家的uin,0表示全部玩家(貌似没有效果)
Chat:sendChat("这是一条聊天消息!",0)
Chat:sendChat("也可以只输入消息内容,默认发给全部玩家")

# 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:
--发送一条系统消息
--第一个参数是消息内容,第二个参数是接收消息的玩家的uin,0表示全部玩家(貌似没有效果)
Chat:sendSystemMsg("这是一条系统消息!",0)
Chat:sendSystemMsg("也可以只输入消息内容,默认发给全部玩家")
Last Update: 6/11/2020, 9:30:46 PM