Differences

This shows you the differences between two versions of the page.

Link to this comparison view

shortcuts [2013/09/12 22:49] (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)//​ returns any existing shortcut for the long description. If no shortcut is yet defined it returns //$long// unmodified back.
 +  * //$this -> bot -> shortcuts -> get_long($short)//​ returns any existing long description of //$short//. If no description is in the database it returns //$short// unmodified back.
 +  * //$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)//​ removes the long description to //$short// as well as the shortcut if it exists. This function returns an array.
 +  * //$this -> bot -> shortcuts -> delete_description($long)//​ removes the shortcut to //$long// as well as the long description if it exists. This function returns an array.
 +  * //$this -> bot -> shortcuts -> delete_id($id)//​ removes the shortcut and long description indexed by //$id// if it exists. This function returns an array.
 
shortcuts.txt ยท Last modified: 2013/09/12 22:49 (external edit)
[unknown button type]
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
WikiForumIRCBugs
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki