2021-04-05 17:29:49 +02:00
.. _plugin-Alias:
Documentation for the Alias plugin for Supybot
==============================================
Purpose
-------
2021-12-04 02:50:28 +01:00
2021-04-05 17:29:49 +02:00
Allows aliases for other commands. NOTE THAT IT'S RECOMMENDED TO USE Aka
PLUGIN INSTEAD!
Usage
-----
2021-12-04 02:50:28 +01:00
2021-04-05 17:29:49 +02:00
This plugin allows users to define aliases to commands and combinations
of commands (via nesting).
This plugin is only kept for backward compatibility, you should use the
built-in Aka plugin instead (you can migrate your existing aliases using
the 'importaliasdatabase' command.
To add an alias, `trout` , which expects a word as an argument::
<jamessan> @alias add trout "action slaps $1 with a large trout"
<bot> jamessan: The operation succeeded.
<jamessan> @trout me
* bot slaps me with a large trout
To add an alias, `lastfm` , which expects a last.fm user and replies with
their recently played items::
@alias add lastfm "rss [format concat http://ws.audioscrobbler.com/1.0/user/ [format concat [urlquote $1] /recenttracks.rss]]"
Note that if the nested commands being aliased hadn't been quoted, then
those commands would have been run immediately, and `@lastfm` would always
reply with the same information, the result of those commands.
2021-04-05 22:56:40 +02:00
.. _commands-Alias:
2021-04-05 17:29:49 +02:00
Commands
--------
2021-12-04 02:50:28 +01:00
2021-04-17 20:09:33 +02:00
.. _command-alias-add:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
add <name> <command>
Defines an alias <name> that executes <command>. The <command> should be in the standard "command argument [nestedcommand argument]" arguments to the alias; they'll be filled with the first, second, etc. arguments. $1, $2, etc. can be used for required arguments. @1, @2, etc. can be used for optional arguments. $* simply means "all remaining arguments," and cannot be combined with optional arguments.
2021-04-17 20:09:33 +02:00
.. _command-alias-list:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
list [--locked|--unlocked]
Lists alias names of a particular type, defaults to all aliases if no --locked or --unlocked option is given.
2021-04-17 20:09:33 +02:00
.. _command-alias-lock:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
lock <alias>
Locks an alias so that no one else can change it.
2021-04-17 20:09:33 +02:00
.. _command-alias-remove:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
remove <name>
Removes the given alias, if unlocked.
2021-04-17 20:09:33 +02:00
.. _command-alias-unlock:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
unlock <alias>
Unlocks an alias so that people can define new aliases over it.
2021-04-17 20:09:33 +02:00
.. _conf-Alias:
2021-04-05 17:29:49 +02:00
Configuration
-------------
2021-04-17 20:09:33 +02:00
2021-04-22 00:29:15 +02:00
.. _conf-supybot.plugins.Alias.aliases:
supybot.plugins.Alias.aliases
This is a group of:
.. _conf-supybot.plugins.Alias.escapedaliases:
supybot.plugins.Alias.escapedaliases
This is a group of:
2021-04-17 20:09:33 +02:00
.. _conf-supybot.plugins.Alias.public:
2021-04-22 00:29:15 +02:00
2021-04-05 17:29:49 +02:00
supybot.plugins.Alias.public
2021-12-04 03:19:12 +01:00
This config variable defaults to "True", is not network-specific, and is not channel-specific.
2021-04-05 17:29:49 +02:00
Determines whether this plugin is publicly visible.
2021-04-17 20:09:33 +02:00
.. _conf-supybot.plugins.Alias.validName:
2021-04-22 00:29:15 +02:00
2021-04-05 17:29:49 +02:00
supybot.plugins.Alias.validName
2021-12-04 03:19:12 +01:00
This config variable defaults to "^[^\\x00-\\x20]+$", is not network-specific, and is not channel-specific.
2021-04-05 17:29:49 +02:00
Regex which alias names must match in order to be valid