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.
2022-07-09 23:15:57 +02:00
To add an alias, `` trout `` , which expects a word as an argument::
2021-04-05 17:29:49 +02:00
<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
2022-07-09 23:15:57 +02:00
Add an alias, `` randpercent `` , which returns a random percentage value::
2021-04-05 17:29:49 +02:00
2022-07-09 23:15:57 +02:00
@alias add randpercent "squish [dice 1d100]%"
2021-04-05 17:29:49 +02:00
2022-07-09 23:15:57 +02:00
This requires the `` Filter `` and `` Games `` plugins to be loaded.
Note that nested commands in an alias should be quoted, or they will only
run once when you create the alias, and not each time the alias is
called. (In this case, not quoting the nested command would mean that
`` @randpercent `` always responds with the same value!)
2021-04-05 17:29:49 +02:00
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