Channel Object
Methods
getHistory
local channel = API.channel.cache("testing channel")
local channelHistory = channel:getHistory()local player = game.Players.Player1
local channel = API.channel.cache("testing channel")
local channelHistoryForUser = channel:getHistoryForUser(player.UserId)addMessage
local channelName = "all" --> Specified channel name
local speaker = API.speaker.cache("Player1",false) --> Get speaker for "Player1"
local channel = API.channel.cache(channelName) --> Get channel for "all"
channel:addSpeaker(speaker) --> Add the speaker to channel "all"
local arguments = {
"Player1", --> Speaker name
"Message", --> Speaker message
channelName, --> Channel name
nil, --> Speaker's player object (used for filtering + other things)
"default" --> Message type (do not change)
}
local success,result = API.chatSystem:createMessageObject(unpack(arguments)) --> Create the message object
if(success) then
channel:addMessage(result,true) --> Add the message and make all players in the channel see it with "true"
else
warn("[BETTER CHAT ERROR]:",result) --> Notify of errors that occured when making the message
endisSpeakerInChannel
getSpeakers
addSpeaker
removeSpeaker
Last updated