TextChatMessage

非推奨を表示

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。

作成できません

テキストチャットメッセージを表す不変のデータオブジェクト。

TextChatMessages の使用について詳しくは、体験内テキストチャット を参照してください。

概要

プロパティ

プロパティ

BubbleChatMessageProperties

並列読み取り

ChatWindowMessageProperties

並列読み取り

MessageId

並列読み取り

TextChatMessage のユニークな識別子。

Metadata

並列読み取り

一般的な目的のフィールドで、TextChatMessage に関する雑多なデータを保存する。TextChannel:SendAsync()TextChannel:DisplaySystemMessage() の 2番目の引数は、このフィールドを満たすために使用されます。

このフィールドを使用して、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.友達が参加しました</code></td>
<td>プレイヤーの友達がエクスペリエンスに参加すると表示されます。</td>
</tr>
<tr>
<td><code>Roblox.MessageStatus.警告arning.Floodchecked</code></td>
<td>プレイヤーがサーバーにメッセージを送信したときに制限速度が適用された場合に表示されます。</td>
</tr>
<tr>
<td><code>Roblox.MessageStatus.警告arning.TextFilterFailed</code></td>
<td>プレイヤーが送信したメッセージがテキストフィルタリングの問題により表示できないときに表示されます。</td>
</tr>
<tr>
<td><code>Roblox.MessageStatus.警告.無効な個人情報設定</code></td>
<td>プレイヤーのプライバシー設定がメッセージを送信できないようにすると、表示されます。</td>
</tr>
<tr>
<td><code>Roblox.MessageStatus.警告.MessageToo長</code></td>
<td>プレイヤーが長すぎる内容のメッセージを送信したときに表示されます。</td>
</tr>
<tr>
<td><code>Roblox.MessageStatus.警告arning.Unknown</code></td>
<td>システムが不明な理由でプレイヤーのメッセージを送信できないときに表示されます。</td>
</tr>
<tr>
<td><code>ロブロックス.Help.Info</code></td>
<td>RBXHelpCommand の応答を表示します。Class.TextChatCommand。</td>
</tr>
<tr>
<td><code>ロブロックス.Version.Info</code></td>
<td><code>RBXVersionCommand</code><code>Class.TextChatCommand</code> からの応答を表示します。</td>
</tr>
<tr>
<td><code>Roblox.Team.Success.NowInチーム</code></td>
<td>プレイヤーのチームが変更されたときに表示されます。</td>
</tr>
<tr>
<td><code>Roblox.Team.Error.CannotチームチャットIfNotInチーム</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.Sentへ</code></td>
<td>ささやき <code>Class.TextChannel</code> を入力すると表示されます。</td>
</tr>
<tr>
<td><code>Roblox.Whisper.Error. SuddenlyWhisperToSelf によるエラー</code></td>
<td>RBXWhisperCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Whisper.Error.ターゲットが存在しません</code></td>
<td>RBXWhisperCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Whisper.Error.太多のマッチ</code></td>
<td>RBXWhisperCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Whisper.Error.Unknown</code></td>
<td>RBXWhisperCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Emote.Error。存在しません</code></td>
<td>RBXEmoteCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Emote.Error.ユーザーエモートが有効でない</code></td>
<td>RBXEmoteCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Emote.Error.TemporarilyUnavailable</code></td>
<td>RBXEmoteCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Emote.Error.Not supportedのエラー</code></td>
<td>RBXEmoteCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Emote.Error.切り替えR15</code></td>
<td>RBXEmoteCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Emote.Error.アニメーション再生</code></td>
<td>RBXEmoteCommand の <code>エラー応答</code><code>Class.TextChatCommand</code> 。</td>
</tr>
<tr>
<td><code>Roblox.Mute.Error.PlayerInitialized というエラー</code></td>
<td><code>RBXMuteCommand</code><code>Class.TextChatCommand</code> からのエラー応答。</td>
</tr>
<tr>
<td><code>Roblox.Mute.Error.複数のマッチ</code></td>
<td><code>RBXMuteCommand</code><code>Class.TextChatCommand</code> からのエラー応答。</td>
</tr>
<tr>
<td><code>Roblox.Mute.Error.CanvasMute のエラー</code></td>
<td><code>RBXMuteCommand</code><code>Class.TextChatCommand</code> からのエラー応答。</td>
</tr>
<tr>
<td><code>Roblox.Mute.Info.Success</code></td>
<td>RBXMuteCommand クラスからの成功応答 Class.TextChatCommand。</td>
</tr>
<tr>
<td><code>Roblox.Unmute.Error.PlayerInitialized による</code></td>
<td><code>RBXUnmuteCommand</code><code>Class.TextChatCommand</code> からのエラー応答。</td>
</tr>
<tr>
<td><code>Roblox.Unmute.Error.複数のマッチ</code></td>
<td><code>RBXUnmuteCommand</code><code>Class.TextChatCommand</code> からのエラー応答。</td>
</tr>
<tr>
<td><code>Roblox.Unmute.Error.Canvas を無効にできません</code></td>
<td><code>RBXUnmuteCommand</code><code>Class.TextChatCommand</code> からのエラー応答。</td>
</tr>
<tr>
<td><code>Roblox(ロブロックス)ブロックス.Unmute.Info.Success</code></td>
<td>RBXUnmuteCommand の成功応答 クラス.TextChatCommand 。</td>
</tr>
</tbody>
メタデータ

PrefixText

並列読み取り

ユーザーのメッセージに追加するプレフィックス。これはリッチテキストをサポートしているので、開発者はこのテキストのカスタムプロパティを設定して、チャットタグをサポートできます。

デフォルトでは、 は、 という名前で、ユーザーが を介して にアクセスするものです。

並列読み取り

TextChatMessage のステータスを示します。

Text

並列読み取り

ユーザーのためにフィルタリングされたテキストメッセージ。異なるユーザーが、フィルタールールに基づいてこのプロパティから異なる文字列を受け取る可能性があります。空の文字列である可能性があります。

TextChannel

並列読み取り

起源への参照 TextChannel

TextSource

並列読み取り

起源への参照 TextSource

Timestamp

並列読み取り

メッセージが最初に送信された時刻のタイムスタンプ。

Translation

並列読み取り

ユーザーのローカライゼーション設定に基づいて翻訳およびフィルタリングされたテキストメッセージを表示します。システムは、同じローカライゼーション設定を持つユーザー間のメッセージを翻訳したり、テキストフィルターのサポートがない言語を使用したりして翻訳が発生しない場合、このプロパティは空の文字列になる可能性があります。カスタマイズについては、翻訳されたメッセージのカスタマイズ を参照してください。

方法

イベント