-
Notifications
You must be signed in to change notification settings - Fork 20
Commands
Xor commands are called this way:
<prefix><command_name_or_alias> [...arguments]
[input]
The <prefix>
should be one of \
, >
, or those you
configured.
Note that you cannot use custom prefixes as for now.
Also, the current two prefixes have their special meanings which will be clarified below.
Here’s an example of a simple command call:
\ping
Or one with arguments:
\sh whoami
Excluding the arguments, commands can accept longer content called inputs.
If the prefix you use is \
, the input will be all of your command message
excluding the first line which includes the command trigger and the arguments.
But if the prefix you use is >
, the input will be the text of the message
which was replied.
To make this clearer, we can see how the built-in shell
command takes use of
the input you provide.
In the command
\sh grep a
b
c
a
d
a grep
process will be started with the arguments a
. After starting it, the
whole text of your message (excluding its first line) will be passed into the
process’ stdin
. Which will result in grep
finding the a
character in your
command input.
Also, the command
>sh grep a
will do the same thing as above the command, but the input is going to be the text of the message you are replying to.
© 2022 Xor contributors. Licensed under Creative Commons.