[][src]Function hexchat::register_command

pub fn register_command(
    name: &str,
    help_text: &str,
    priority: Priority,
    function: impl Fn(&[String]) -> EatMode + 'static
) -> Command

Registers a new command accessible to the user via /<COMMAND> [args]. Returns a corresponding object that can be passed to deregister_command.

Callback

The callback's signature is a slice of all the command arguments. If you intend to get command arguments, you should probably start at 1; argument 0 is the name of the command. The callback should return who the command event should be hidden from.