채널 관리, 메시지 장식, 텍스트 필터링, 명령 생성 및 사용자 정의 채팅 인터페이스 개발과 같은 경험 없는 텍스트 채팅 처리.
자세한 내용은 경험 내 텍스트 채팅 을 참조하십시오.
요약
속성
Class.TextChatService를 완전히 활성화할지 또는 전통 채팅 시스템으로 되돌릴지 결정합니다.
Class.TextChatService가 기본 TextChatCommands을 만들어야 하는지 여부를 결정합니다.
Class.TextChatService가 기본 TextChannels를 만들어야 하는지 여부를 결정합니다.
메서드
제공된 부품 또는 플레이어 캐릭터 위에 채팅 버블을 표시합니다.
부모 권한 설정에 따라 경험에서 다른 사용자와 직접 채팅할 수 있는 사용자의 권한을 결정합니다.
이벤트
Class.TextChatService:DisplayBubble()가 호출될 때 화재됩니다.
클라이언트에서 TextChannel:DisplaySystemMessage() 를 호출하거나 서버로부터 유효한 TextChannel:SendAsync() 응답을 받으면 화재됩니다.
발생할 수 있는 시간: TextChannel:SendAsync() 클라이언트에서 호출될 때.
콜백
거품 채팅이 표시될 때 호출됩니다.
새로운 메시지가 채팅 창에 표시될 때 호출됩니다. 이 기능은 클라이언트에서만 구현할 수 있습니다.
Class.TextChatService 가 들어오는 메시지를 받을 때 호출됩니다.
속성
ChatTranslationEnabled
ChatVersion
Class.TextChatService를 완전히 활성화할지 또는 전통 채팅 시스템으로 되돌릴지 여부를 결정합니다. 이 속성을 Enum.ChatVersion.LegacyChatService로 설정하면 효과적으로 TextChatService를 비활성화합니다.
CreateDefaultCommands
Class.TextChatService가 기본 TextChatCommands을 만들어야 하는지 여부를 결정합니다.
Class.TextChatCommand|TextChatCommands 이 생성되고 Folder 내에 있는 Class.TextChatCommands 이 이름이 1>Class.TextChatService1> 내에 있습니다.
<tbody><tr><td><b>RBXClearCommand</b></td><td>지우다</td><td>클래스</td><td>로컬 사용자의 채팅 로그를 지우십시오.</td><td><code>/클래스</code></td></tr><tr><td><b>RBX콘솔 명령</b></td><td>콘솔</td><td /><td>개발자 콘솔을 엽니다.</td><td><code>/console</code></td></tr><tr><td><b>RBXEmoteCommand</b></td><td>감정 표현</td><td>e</td><td>아바타 감정 표현플레이합니다.</td><td><code>/e dance</code></td></tr><tr><td><b>RBXHelpCommand</b></td><td>돕다</td><td>?</td><td>채팅 명령의 목록을 표시합니다.</td><td><code>/help</code></td></tr><tr><td><b>RBXMuteCommand</b></td><td>음소거</td><td>분</td><td>Class.Player.Name|Name 또는 <code>Class.Player.DisplayName|DisplayName</code> 을 모든 <code>Class.TextChannel|TextChannels</code> 에서 중지합니다.</td><td><code>/m 사용자 이름</code></td></tr><tr><td><b>RBX팀 명령</b></td><td>팀</td><td>t</td><td>팀원만 메시지를 볼 수 있는 팀 채팅 모드로 들어갑니다.</td><td><code>/t</code></td></tr><tr><td><b>RBXUnmuteCommand</b></td><td>음소거 해제</td><td>음</td><td>Class.Player.Name|Name 또는 <code>Class.Player.DisplayName|DisplayName</code> 을 모든 <code>Class.TextChannel|TextChannels</code> 에서 사용자를 중지 해제합니다.</td><td><code>/um 사용자 이름</code></td></tr><tr><td><b>RBXVersionCommand</b></td><td>버전</td><td>v</td><td>채팅 버전을 표시합니다.</td><td><code>/version</code></td></tr><tr><td><b>RBXWhisperCommand</b></td><td>귓속말</td><td>�</td><td>다른 <code>Class.Player</code>와 함께 조용한 모드로 들어갑니다.</td><td><code>/w DisplayName</code> 또는 <code>/w @Username</code></td></tr></tbody>
이름 | 주요 별칭 | 보조 별칭 | 설명 | 사용 예시 |
---|
Class.TextChatCommand|TextChatCommands 을 편집, 생성 및 제거하는 경우 CreateDefaultCommands 이 진실로 적용됩니다. 또한 음소거 및 음소거 명령이 모든 TextChannels에 적용됩니다.
CreateDefaultTextChannels
Class.
<tbody><tr><td><b>RBXGeneral</b></td><td><code>Class.TextChannel</code> 대한 플레이 메시지. 채팅 창에서 메시지가 변경되어 <code>Class.TextChatMessage.PrefixText|PrefixText</code> 가 풍부 풍부 풍부 풍부 풍부 풍부 풍부 풍부 풍부 풍부 풍부 풍</td></tr><tr><td><b>RBXSystem</b></td><td><code>Class.TextChannel</code> 시스템 메시지용. 채팅 창에서 메시지가 수정되어 <code>Class.TextChatMessage.Text</code> 가 기본적으로 라이트 그레이 색 태그를 가지거나 레드 색 태그를 가지게 되는 경우가 있습니다. <code>Class.TextChatMessage.Metadata</code> 에 단어 0>Error0> 가 포함되어 있으면 경</td></tr><tr><td><b>RBXTeam\[BrickColor]</b></td><td><code>Class.TextChannel</code> 클래스 사용 채널 메시지만, 모든 클래스 플레이어 메시지만 사용 가능합니다. 이 메시지는 모든 클래스 플레이어 메시지만 사용 가능합니다. 이</td></tr><tr><td><b>RBXWhisper:\[UserId1]\_\[userId2]</b></td><td><code>Class.TextChannel</code> 은 플레이어 사이트 사이트 사이트 사이트 사이트 사이트 사이트 사</td></tr></tbody>
채널 | 설명 |
---|
기본 TextChannel.OnIncomingMessage 콜백을 재작성할 수 있습니다. 또한 TextChannels 가 진실인 경우에도 편집, 생성 및 제거할 수 있습니다.
다른 텍스트 채널의 메시지는 ChannelTabsConfiguration를 사용하여 채팅 창에 여러 개의 탭으로 나눌 수 있습니다.
메서드
DisplayBubble
이 메서드에 지정된 부품 또는 플레이어 캐릭터 위에 채팅 버블을 표시하고 BubbleDisplayed 이벤트를 매개 변수를 지정하여 이 메서드에 지정된 부품에 대해 버블을 표시합니다. 이 메서드에 있는 캐릭터 내의 버블을 표시하려면 이 메서드에 있는
이 메서드는 LocalScript 또는 Script 에서만 사용할 수 있으며, RunContext 의 1>Class.Script1> 와 4>Class.Script.Run4> 의 경우에만 사용할 수 있습니다.
매개 변수
반환
CanUsersDirectChatAsync
부모 권한 설정에 따라 경험에서 다른 사용자와 직접 채팅할 수 있는 사용자의 권한을 결정합니다. 다음에 사용할 수 있습니다.
- 통신 라인은 사용자 주도(개발자 또는 게임 플레이 주도)
- 통신에 액세스는 닫힌 채로 제한되어 있습니다
매개 변수
반환
코드 샘플
This example checks if two users can chat, creates a new TextChannel, and adds them to it.
local TextChatService = game:GetService("TextChatService")
local directChatParticipants = TextChatService:CanUsersDirectChatAsync(userId1, { userId2 })
-- Check for eligible participants
if #directChatParticipants > 0 then
local directChannel = Instance.new("TextChannel")
directChannel.Parent = TextChatService
for _, participant in directChatParticipants do
directChannel:AddUserAsync(participant)
end
return directChannel
end
warn("Could not create TextChannel. Not enough eligible users.")
return nil
이벤트
BubbleDisplayed
Class.TextChatService:DisplayBubble()가 호출될 때 화재됩니다.
매개 변수
MessageReceived
클라이언트에서 TextChannel.MessageReceived 를 수신하면 TextChannel:DisplaySystemMessage() 가 실행되거나 서버로부터 유효한 TextChannel:SendAsync() 응답을 수신하면 이 이벤트는 클라이언트에서만 발생합니다.
서버의 TextChannel.ShouldDeliverCallback 속성이 바인딩되고 반환하는 경우 false클라이언트는 발생하지 않습니다 TextChatService.MessageReceived .
Class.TextChatMessage 매개 변수를 사용하여 TextSource 및 메시지 텍스트(TextChatMessage.Text로)를 가져옵니다.
Class.TextChatMessage 매개 변수는 다음 중 하나인 TextChatService.OnIncomingMessage 또는 TextChannel.OnIncomingMessage에 바인딩된 함수의 최종 결과입니다.
매개 변수
받은 TextChatMessage .
SendingMessage
발생하는 경우 TextChannel:SendAsync() 를 호출하는 클라이언트에서 TextChannel:SendAsync() 이 표시됩니다. 이를 사용하여 서버 응답을 기다리는 동안 사용자에게 자리 표시 메시지를 표시할 수 있습니다.
매개 변수
Class.TextChatMessage 에서 TextChannel:SendAsync() 에 대한 전화.
콜백
OnBubbleAdded
거품 채팅이 표시될 때 호출됩니다. 이 기능은 클라이언트에서만 구현할 수 있습니다.
이 메시지를 사용하여 개별 버블 채팅 메시지를 사용자 정의합니다. 이 콜백이 BubbleChatMessageProperties를 반환하면
채팅 메시지가 플레이어가 보낸 경우, message.TextSource 는 해당 플레이어에 일치하고, adornee 는 nil 이 됩니다.
채팅 메시지가 TextChatService:DisplayBubble()를 통해 보낸 경우, adornee는 제공되며, partOrCharacter는 1> nil1>이 됩니다.
매개 변수
수신 TextChatMessage .
버블 채팅 메시지가 부착된 부품 또는 캐릭터.
반환
Class.TextChatMessage 가 반환되면 해당 속성은 연결된 버블에 적용되어 BubbleChatConfiguration 속성을 재정의합니다.
OnChatWindowAdded
새로운 메시지가 채팅 창에 표시될 때 호출됩니다. 이 기능은 클라이언트에서만 구현할 수 있습니다.
이 메시지 섹션에 나타나는 개별 메시지를 사용자 정의하려면 이 콜백을 사용하십시오. 이 콜백이 ChatWindowMessageProperties 속성을
매개 변수
수신 TextChatMessage .
반환
Class.TextChatMessage 가 반환되면 속성이 연관된 메시지에 적용되고 ChatWindowConfiguration 속성을 재정의합니다.
OnIncomingMessage
Class.TextChatService 가 들어오는 메시지를 수신하면 호출됩니다. 클라이언트에서만 구현할 수 있습니다.
이 메서드를 사용하여 TextChatMessages 를 장식합니다. 이 콜백이 TextChatMessageProperties 를 반환하면, 이 속성은 TextChatMessage 매개 변수와 결합되어 새로운 2>Class.TextChatMessage2> 를 생성합니다.
클라이언트에 메시지를 보내는 경우, 이 콜백은 두 번 실행됩니다. 첫 번째로 메시지가 로컬에서 처음 전송되고 받을 때, 그리고 클라이언트가 서버로부터 필터링된 메시지의 결과를 받을 때.
이 TextChatService.OnIncomingMessage 콜백은 모든 Class.TextChannel.OnIncomingMessage 콜백 전에 실행됩니다.
이 정의는 소스 코드에서만 정의해야 합니다. 여러 바인딩은 비동기적인 방식으로 서로 중첩됩니다.
매개 변수
수신 TextChatMessage .
반환
Class.TextChatMessageProps 가 반환되면 이 속성은 TextChatMessage 매개 변수와 함께 병합되어 새로운 TextChatMessage를 만듭니다. 그렇지 않으면 일반적으로 반환되는 1>nil1>이 반환되면 새로운 4>