TextChatCommand

顯示已棄用項目

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡

代表文字聊天指令。可以用於當父輩到 TextChatService 時創建自定義文字聊天指令。

自訂指令最多可以有兩個別名,並且當使用者輸入聊天室「/PrimaryAlias」或「/SecondaryAlias」時,發生觸發事件。對於自訂指令的範例,請參閱 自訂文字聊天指令

要了解更多關於使用 TextChatService 的信息,請參閱 體驗內文字聊天

屬性

AutocompleteVisible

平行讀取

Enabled

平行讀取

決定是否啟用 TextChatCommand

當停用時,匹配「/PrimaryAlias」或「/SecondaryAlias」的訊息不會被沉沒,並且會傳送給其他使用者。

使用此來禁用在案件基礎上的預設指令。

PrimaryAlias

平行讀取

主要別名用於觸發 TextChatCommand

如果使用者發送含有 TextChannel:SendAsync() 匹配 "/`Class.TextChatCommand.PrimaryAlias`" 的消息,則該消息不會被傳送,而是 TextChatCommand.Triggered 被發射。

SecondaryAlias

平行讀取

一個次要別名用於觸發 TextChatCommand

方法

活動

Triggered

開發人員可以綁定以執行指令的事件。

當使用者透過 TextChannel:SendAsync() 向伺服器傳送訊息時,訊息會被 TextChatCommand 截取,如果訊息內容匹配 "/`Class.TextChatCommand.PrimaryAlias`" 或 "/`Class.TextChatCommand.SecondaryAlias`",則不會複製到其他使用者。

例如,對於 TextChatCommandTextChatCommand.PrimaryAlias 為「靜音」的情況,如果使用者發送「/mute SomeUserName」,則相關的 TextChatCommand 靜音將發射其 TextChatCommand.Triggered 。訊息「/mute SomeUserName」不會複製給其他使用者。

參數

originTextSource: TextSource

一個引用到 TextSource 負責通過 TextChannel:SendAsync() 啟動命令的參考。

unfilteredText: string

完整、未過濾的文字,用於觸發可用於分解指令訊息中參數的指令。