Table of Contents

Interface ICommandParser

Namespace
Signal.Application.Commands.Parsing
Assembly
Signal.Application.dll

Recognises command invocations in message text.

public interface ICommandParser

Methods

TryParse(string?, out ParsedCommand?)

Parses text if it starts with a configured prefix directly followed by a command name.

bool TryParse(string? text, out ParsedCommand? command)

Parameters

text string

The message text.

command ParsedCommand

The parsed invocation when the method returns true.

Returns

bool

true if the text is a command invocation.

TryParse(string?, IReadOnlyList<string>, out ParsedCommand?)

Parses text using prefixes instead of the configured ones (per-conversation prefixes). Added after 0.4; the default ignores prefixes and uses the configured prefixes.

bool TryParse(string? text, IReadOnlyList<string> prefixes, out ParsedCommand? command)

Parameters

text string

The message text.

prefixes IReadOnlyList<string>

The prefixes to accept (longest match wins).

command ParsedCommand

The parsed invocation when the method returns true.

Returns

bool

true if the text is a command invocation.