TextChatCommand

Show Deprecated

Represents a text chat command. It must be parented to TextChatService as a descendant to function properly.

Summary

Properties

Determines whether the TextChatCommand is enabled.

A primary alias used to trigger the TextChatCommand.

A secondary alias used to trigger the TextChatCommand.

Events

Triggered(originTextSource: TextSource, unfilteredText: string): RBXScriptSignal  

An event that developers can bind to execute commands.

Methods

Properties

Enabled

Determines whether the TextChatCommand is enabled.

When disabled, messages that match "/{PrimaryAlias}" or "/{SecondaryAlias}" is not sunk and is sent to other users.

Use this to disable default commands on a case-by-case basis.

PrimaryAlias

A primary alias used to trigger the TextChatCommand.

If a user sends a message with TextChannel:SendAsync() that matches "/{TextChatCommand.PrimaryAlias}", then the message is not sent and instead TextChatCommand.Triggered is fired.

SecondaryAlias

A secondary alias used to trigger the TextChatCommand.

Events

Triggered

An event that developers can bind to execute commands.

When a user sends a message to the server via TextChannel:SendAsync(), the message is intercepted by the TextChatCommand and not replicated to other users if the content of the message matches "/{TextChatCommand.PrimaryAlias}" or "/{TextChatCommand.SecondaryAlias}".

For example, for a TextChatCommand with TextChatCommand.PrimaryAlias as "mute", if a user sends "/mute SomeUserName", then the relevant TextChatCommand for mute will fire its TextChatCommand.Triggered. The message "/mute SomeUserName" is not replicated to other users.

Parameters

originTextSource: TextSource

A reference to the TextSource responsible for triggering the command via TextChannel:SendAsync().

unfilteredText: string

The full, unfiltered text used to trigger the command that can be used to dissect parameters from the command message.


Methods