Table of Contents

Delegate PrefixResolverDelegate

Namespace
DisCatSharp.CommandsNext
Assembly
DisCatSharp.CommandsNext.dll

Represents a delegate for a function that takes a message, and returns the position of the start of command invocation in the message. It has to return -1 if prefix is not present.

It is recommended that helper methods GetStringPrefixLength(DiscordMessage, string, StringComparison) and GetMentionPrefixLength(DiscordMessage, DiscordUser) be used internally for checking. Their output can be passed through.

public delegate Task<int> PrefixResolverDelegate(DiscordMessage msg)

Parameters

msg DiscordMessage

Message to check for prefix.

Returns

Task<int>

Position of the command invocation or -1 if not present.