TextChatMessage
*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่
วัตถุข้อมูลที่ไม่สามารถเปลี่ยนแปลงได้ที่แทนที่ข้อความแชทข้อความข้อความ
เพื่อเรียนรู้เพิ่มเติมเกี่ยวกับการใช้ TextChatMessages ดู การแชทข้อความในประสบการณ์
สรุป
คุณสมบัติ
ตัวระบุเฉพาะสำหรับ TextChatMessage .
ฟิลด์ประเภททั่วไปสำหรับการจัดเก็บข้อมูลเบ็ดเตล็ดเกี่ยวกับ TextChatMessage
คํานําหน้าที่จะเพิ่มไปยังข้อความของผู้ใช้
บ่งบอกสถานะของ TextChatMessage .
ข้อความข้อความที่กรองสำหรับผู้ใช้
การอ้างอิงถึงที่มา TextChannel
การอ้างอิงถึงที่มา TextSource
เวลาที่ต้นฉบับของข้อความถูกส่งครั้งแรก
ข้อความข้อความแปลและกรองแล้ว
คุณสมบัติ
BubbleChatMessageProperties
ChatWindowMessageProperties
Metadata
ฟิลด์ประเภททั่วไปสำหรับการจัดเก็บข้อมูลเบ็ดเตล็ดเกี่ยวกับ TextChatMessageอาร์กิวเมนต์ที่สองของ TextChannel:SendAsync() และ TextChannel:DisplaySystemMessage() ถูกใช้เพื่อเติมฟิลด์นี้
ใช้ฟิลด์นี้เพื่อใช้รูปแบบเพิ่มเติมสำหรับข้อความพิเศษภายใน TextChatService.OnIncomingMessage และ TextChannel.OnIncomingMessage คอลเลกชันการโทรกลับ
local TextChatService = game:GetService("TextChatService")
local generalChannel: TextChannel = TextChatService:WaitForChild("TextChannels").RBXGeneral
generalChannel:DisplaySystemMessage("This is an error!", "Game.Error.Generic")
generalChannel:DisplaySystemMessage("Could not find save data!", "Game.Error.SaveDataNotFound")
generalChannel:DisplaySystemMessage("You won the game!", "Game.Info.Win")
generalChannel:DisplaySystemMessage("You lost the game!", "Game.Info.Lose")
generalChannel.OnIncomingMessage = function(message: TextChatMessage)
if string.find(message.Metadata, "Error") then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.TextColor = Color3.fromRGB(255, 0, 0)
return overrideProperties
elseif string.find(message.Metadata, "Info") then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.TextColor = Color3.fromRGB(0, 255, 150)
return overrideProperties
end
return nil
end
ต่อไปนี้เป็นการอ้างอิงถึงข้อความระบบเริ่มต้นที่ออกโดยระบบแชท:
<th>คําอธิบาย</th></tr></thead><tbody><tr><td><code>Roblox.ChatTranslation.ChatWindow.SystemMessage</code></td><td>บ่งชี้ว่าระบบอาจแปลข้อความแชทสำหรับผู้เล่น</td></tr><tr><td><code>Roblox.Notification.Friend.เข้าร่วม</code></td><td>แสดงเมื่อเพื่อนของผู้เล่นคนหนึ่งเข้าร่วมประสบการณ์</td></tr><tr><td><code>Roblox.MessageStatus.คำเตือน.Floodchecked</code></td><td>แสดงเมื่อข้อความที่ผู้เล่นส่งถูกจํากัดอัตราโดยเซิร์ฟเวอร์</td></tr><tr><td><code>Roblox.MessageStatus.คำเตือน.TextFilterล้มเหลว</code></td><td>แสดงเมื่อข้อความที่ส่งโดยผู้เล่นไม่สามารถแสดงได้เนื่องจากปัญหาการกรองข้อความ</td></tr><tr><td><code>Roblox.MessageStatus.คำเตือน.การตั้งค่าส่วนตัวที่ไม่ถูกต้อง</code></td><td>แสดงเมื่อการตั้งค่าความเป็นส่วนตัวของผู้เล่นป้องกันไม่ให้พวกเขาส่งข้อความ</td></tr><tr><td><code>Roblox.MessageStatus.คำเตือน.Messageยาวเกินไป</code></td><td>แสดงเมื่อผู้เล่นส่งข้อความที่มีเนื้อหายาวเกินไป</td></tr><tr><td><code>Roblox.MessageStatus.คำเตือน.Unknown</code></td><td>แสดงเมื่อระบบล้มเหลวในการส่งข้อความผู้เล่นด้วยเหตุผลที่ไม่รู้จัก</td></tr><tr><td><code>ข้อมูลช่วยเหลือ Roblox.Help.Info</code></td><td>แสดงคำตอบจาก <code>RBXHelpCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Version.Info</code></td><td>แสดงคำตอบจาก <code>RBXVersionCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Team.Success.NowInTeam(ไทย)(อังกฤษ)</code></td><td>แสดงเมื่อทีมของผู้เล่นเปลี่ยน</td></tr><tr><td><code>Roblox.Team.Error.CannotTeamChatIfNotInTeam คือ</code></td><td>แสดงเมื่อผู้เล่นกระตุ้น <code>RBXTeamCommand</code><code>Class.TextChatCommand</code> โดยไม่ต้องอยู่บน <code>Class.Team</code></td></tr><tr><td><code>Roblox.Whisper.Info.สำเรจ</code></td><td>แสดงเมื่อผู้เล่นเริ่มสนทนากับเสียงกระซิบสําเร็จ</td></tr><tr><td><code>Roblox.Whisper.Welcome.ส่ง</code></td><td>แสดงเมื่อใส่คํากระซิบ <code>Class.TextChannel</code></td></tr><tr><td><code>Roblox.Whisper.Error.ไม่สามารถข่มขู่ตัวเองได้</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXWhisperCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Whisper.Error.Targetไม่มีอยู่</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXWhisperCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Whisper.Error.TooManyMatches(ไทย)ค้นหาค้นหา(ไทย)</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXWhisperCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Whisper.Error.Unknownเอกสารทางเทคนิคไทย:Roblox.Whisper.Error.Unknown</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXWhisperCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Emote.Error.ไม่มีอยู่</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXEmoteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Emote.Error.UserEmotesไม่เปิดใช้งาน</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXEmoteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Emote.Error.ไม่สามารถใช้งานชั่วคราว</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXEmoteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Emote.Error.NotSupported ไม่สนับสนุน</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXEmoteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Emote.Error.SwitchToR15</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXEmoteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Emote.Error.AnimationPlaying(ไทย)(ไทย)</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXEmoteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Mute.Error.PlayerNotFoundสิ่งที่เกิดขึ้นเมื่อผู้เล่นไม่พบ</code></td><td>คำตอบข้อผิดพลาดจาก <code>RBXMuteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Mute.Error.MultipleMatches(ไทย)คำอธิบายข้อผิดพลาด</code></td><td>คำตอบข้อผิดพลาดจาก <code>RBXMuteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Mute.Error.CannotMuteSelf(ไทย)คำอธิบายข้อผิดพลาดRoblox.Mute.Error.CannotMuteSelf</code></td><td>คำตอบข้อผิดพลาดจาก <code>RBXMuteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Mute.Info.สำเร็จ</code></td><td>คําตอบสําเร็จจาก <code>RBXMuteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Unmute.Error.PlayerNotFound(ไทย)ค้นหาค้นหา(ไทย)</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXUnmuteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Unmute.Error.MultipleMatches</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXUnmuteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Unmute.Error.CannotMuteSelf(ไทย)คำอธิบายข้อผิดพลาดRoblox.Unmute.Error.CannotMuteSelf</code></td><td>คําตอบข้อผิดพลาดจาก <code>RBXUnmuteCommand</code><code>Class.TextChatCommand</code></td></tr><tr><td><code>Roblox.Unmute.Info.สำเรจ</code></td><td>คําตอบสําเร็จจาก <code>RBXUnmuteCommand</code><code>Class.TextChatCommand</code></td></tr></tbody>
เมทาดาต้า |
---|
PrefixText
คํานําหน้าที่จะเพิ่มไปยังข้อความของผู้ใช้ สิ่งนี้สนับสนุนข้อความที่มีเนื้อหารวย ดังนั้นนักพัฒนาสามารถกําหนดคุณสมบัติที่กําหนดเองสําหรับข้อความนี้เพื่อสนับสนุนแท็กแชท
โดยค่าเริ่มต้น TextChatMessage.PrefixText คือชื่อของ TextSource ซึ่งเป็น Player.DisplayName ของผู้ใช้ที่เกี่ยวข้องกับ TextSource ผ่าน TextSource.UserId
Text
ข้อความข้อความที่กรองสำหรับผู้ใช้ผู้ใช้ที่แตกต่างกันอาจได้รับสตริงที่แตกต่างกันจากคุณสมบัตินี้ตามกฎการกรองมันอาจเป็นสตริงว่างเปล่า
Translation
แทนที่ข้อความข้อความแปลและกรองตามการตั้งค่าการแปลภาษาท้องถิ่นของผู้ใช้ระบบไม่แปลข้อความระหว่างผู้ใช้ที่มีการตั้งค่าการแปลเดียวกันหรือใช้ภาษาโดยไม่มีการสนับสนุนตัวกรองข้อความ ดังนั้นคุณสมบัตินี้จึงอาจเป็นข้อความว่างเปล่าหากไม่มีการแปลเกิดขึ้นสำหรับการปรับแต่งดูที่ ปรับแต่งข้อความที่แปล