Ghost Commands
  • Getting Started
    • Quickstart
    • Syntax
      • Command syntax
      • Arguments with multiple values
    • Custom commands
  • Documentation
    • Commands
      • Static commands
      • Non-static commands
      • Dynamic commands
      • Overloads
      • Parameters
      • Additional attributes
    • Suggestions
      • Suggestion attributes
      • Suggestor methods
    • Converters
      • Custom parameter types
      • Using the ArgumentReader
      • Multiple ways to interpret an argument
    • Processors
      • Creating a processor
      • Setting priorities
      • Cheat codes example
    • Macros
    • Settings
    • Customization
    • Included Commands
Powered by GitBook
On this page

Was this helpful?

  1. Documentation
  2. Processors

Creating a processor

Create a static method that returns a string and mark it as a processor using the [Processor] attribute. This example removes exclamation marks from the input. In case you want to prevent aggressive commands.

[Processor]
public static string RemoveExclamationProcessor(string input)
{
    return input.Replace("!", string.Empty);
}

Caution

You may not wanna go overboard with processors, as it could lead to unexpected behaviour if not handled with caution. Remember to make sure the final string is still executable after being modified.

PreviousProcessorsNextSetting priorities

Last updated 7 months ago

Was this helpful?