mirror of
https://github.com/Mikaela/Limnoria-doc.git
synced 2025-06-02 04:47:32 +02:00
use/faq: Add 'How do I create a command?' section
This commit is contained in:
parent
b8bd902927
commit
7e289290f3
30
use/faq.rst
30
use/faq.rst
@ -59,6 +59,36 @@ My bot can't handle nicks with brackets in them!
|
|||||||
`supybot.commands.nested.brackets` to some other value (like ``<>``,
|
`supybot.commands.nested.brackets` to some other value (like ``<>``,
|
||||||
which can't occur in IRC nicks).
|
which can't occur in IRC nicks).
|
||||||
|
|
||||||
|
How do I create a command?
|
||||||
|
==========================
|
||||||
|
|
||||||
|
You can create simple commands with the Aka plugin, like this::
|
||||||
|
|
||||||
|
<admin> @aka add "rules" "echo Here are the rules of the channel."
|
||||||
|
<bot> Ok.
|
||||||
|
[...]
|
||||||
|
<user> @rules
|
||||||
|
<bot> Here are the rules of the channel.
|
||||||
|
|
||||||
|
You can also make the bot reply on arbitrary words, MessageParser::
|
||||||
|
|
||||||
|
<admin> @messageparser add "some words" "echo Blah blah"
|
||||||
|
<bot> Ok
|
||||||
|
[...]
|
||||||
|
<user> I am saying some words.
|
||||||
|
<bot> Blah blah
|
||||||
|
|
||||||
|
Both these examples assume you have the Utilities plugin loaded
|
||||||
|
(it provides the ``echo`` command).
|
||||||
|
|
||||||
|
See the help of ``aka add``, ``messageparser add``, and ``echo``
|
||||||
|
to see more advanced uses of these commands
|
||||||
|
(command arguments, regular expressions, variables, etc.)
|
||||||
|
|
||||||
|
While powerful, Aka and MessageParser cannot do everything.
|
||||||
|
For the most advanced commands, you will need to
|
||||||
|
:ref:`write your own plugin in Python <develop-plugins>`.
|
||||||
|
|
||||||
I loaded Alias before, how do I move to Aka?
|
I loaded Alias before, how do I move to Aka?
|
||||||
============================================
|
============================================
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user