Native alias integration
Aliases
Section titled “Aliases”Aliases are command shortcuts you define in the Aliases dialog or with /alias. They are independent of scripts. Default aliases are /j, /p, /w, /q, /m, /n, /slap and /ns.
Managing aliases
Section titled “Managing aliases”- The Aliases button opens a graphical editor with a live preview.
/aliaslists aliases;/alias nameshows one./alias name command | command ...defines an alias. The|split happens once, when you define it./alias -d namedeletes;/alias -on nameand/alias -off nameenable and disable;/alias -resetrestores the default pack;/alias -echo on|offtoggles the echo.
Syntax
Section titled “Syntax”One command per line, at most 16 lines per alias. The leading / is optional. Names are case-insensitive letters, digits and underscores, 1 to 32 characters.
| Token | Meaning |
|---|---|
$1 … $99 |
The nth argument; empty if missing |
$n- |
Argument n to the end |
$n-m |
Arguments n to m, inclusive |
$$n |
Like $n, but the alias does not run if the argument is missing |
$0 |
The number of arguments |
$me |
Your current nickname |
$chan |
The channel window you typed in |
$target, $active |
The channel or conversation window you typed in |
$network, $server |
The network name; the server that welcomed you |
\$ |
A literal $ |
!command |
Run the built-in even if an alias has that name |
The command word must be literal. Substituted text is never scanned again, never split on |, and never turns into another command.
Safeguards
Section titled “Safeguards”- Expansion is validated before anything is sent.
- Expanded commands use the normal outbound rate limit.
quote,server,quit,connectanddisconnectmay appear in an alias only if you tick Allow raw and connection commands in the editor. Aliases created with/aliasor imported never get that permission.- Only text you type expands aliases. Received messages, topics and server replies never can.
- Messages to services and anything that may carry credentials are hidden from the echo.
Limits
Section titled “Limits”500 aliases; 16 lines of 1024 bytes each; nesting depth 8; at most 16 commands per use.
Running aliases from a script
Section titled “Running aliases from a script”With the aliases permission:
swizzin.alias(name, args?, network?, target?)This runs one of your own native aliases through the normal command dispatcher, with the same expansion, credential checks and nesting limits as typed input.
targetis the conversation it runs in (used for$chan).- Only enabled aliases without the Allow raw and connection commands option qualify.
- The result may only be chat lines, joins and parts, at most 10 lines.
- It runs only while the network is connected.
- Refusals are written to the Console with the reason.
Because of these rules a script can never reach /quit, /quote, /server or connection control through an alias.