Differences
This shows you the differences between two versions of the page.
shortcuts [2013/09/12 22:49] |
shortcuts [2020/09/12 01:30] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Introduction ====== | ||
+ | The central shortcut database allows using the easy use of shortcuts for long descriptions in modules, as well as returning the corresponding long descriptions for shortcuts. The table storing the shortcuts is per default shared among all bots in the same database. The module [[ShortCutsGUI.php]] offers an interface to store new entries and delete existing entries in the cache. | ||
+ | ====== Using shortcuts in modules ====== | ||
+ | The shortcuts core offers several functions to access and edit the shortcut database. All the functions ignore the cases of shortcuts and long descriptions. Any array returned is a [[BeBot Standard Return Array]]. | ||
+ | * //$this -> bot -> shortcuts -> get_short($long)// | ||
+ | * //$this -> bot -> shortcuts -> get_long($short)// | ||
+ | * //$this -> bot -> shortcuts -> add($short, $long)// adds a new entry to the cache as long as neither //$short// nor //$long// are in the database yet. This function returns an array. | ||
+ | * //$this -> bot -> shortcuts -> delete_shortcut($short)// | ||
+ | * //$this -> bot -> shortcuts -> delete_description($long)// | ||
+ | * //$this -> bot -> shortcuts -> delete_id($id)// |