From c7a5443d68b1e9e09a614bec9adc326ef2dbc4c5 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 16 Feb 2020 12:22:05 -0800 Subject: [PATCH] doc/Commands.md: add Functions --- doc/Commands.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/Commands.md b/doc/Commands.md index 08695078..48e383f3 100644 --- a/doc/Commands.md +++ b/doc/Commands.md @@ -13,6 +13,7 @@ * [Built-in commands](#built-in-commands) * [Creating new built-in commands](#creating-new-built-in-commands) * [Plugins](#plugins) + * [Functions](#functions) * [Factoids](#factoids) * [Code Factoids](#code-factoids) * [Modules](#modules) @@ -205,6 +206,18 @@ stand-alone self-contained units of code that can be loaded by the PBot owner. * only bot owner can install and load PBot Plugins * PBot Plugins have access to PBot internal API functions and data structures +#### Functions +Functions are commands that accept input, manipulate it and then output the result. They are extremely +useful with [piping](#piping) or [command substituting](#substitution). + +For example, the `uri_escape` function demonstrated in the [Substitutions](#substitutions) section earlier +makes text safe for use in a URL. We also saw the `sed` and `uc` functions demonstrated in [Piping](#piping). + +Functions can be loaded via PBot Plugins. + +* only bot owner can load new Functions +* Functions have access to PBot internal API functions and data structures + ### Factoids Factoids are another type of command. Factoids are simple text commands which anybody can create. In their most basic form, they simply display their text