mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
Improve some documentation/examples for bot stuff
Summary: This doesn't fully update the docs, but at least removes the most blatant lies. Test Plan: looked at the document with my eyeballs Reviewers: indiefan, staticshock Reviewed By: staticshock CC: aran Differential Revision: https://secure.phabricator.com/D4959
This commit is contained in:
parent
73991bb262
commit
1e5d1f6534
2 changed files with 18 additions and 23 deletions
|
@ -6,7 +6,6 @@
|
||||||
"#phabot-test"
|
"#phabot-test"
|
||||||
],
|
],
|
||||||
"handlers" : [
|
"handlers" : [
|
||||||
"PhabricatorIRCProtocolHandler",
|
|
||||||
"PhabricatorBotObjectNameHandler",
|
"PhabricatorBotObjectNameHandler",
|
||||||
"PhabricatorBotSymbolHandler",
|
"PhabricatorBotSymbolHandler",
|
||||||
"PhabricatorBotLogHandler",
|
"PhabricatorBotLogHandler",
|
||||||
|
@ -20,7 +19,6 @@
|
||||||
"conduit.cert" : null,
|
"conduit.cert" : null,
|
||||||
|
|
||||||
"macro.size" : 48,
|
"macro.size" : 48,
|
||||||
"macro.sleep" : 0.25,
|
|
||||||
"macro.aspect" : 0.66,
|
"macro.aspect" : 0.66,
|
||||||
|
|
||||||
"notification.channels" : ["#phabot-test"]
|
"notification.channels" : ["#phabot-test"]
|
|
@ -1,22 +1,23 @@
|
||||||
@title IRCBot Technical Documentation
|
@title Chat Bot Technical Documentation
|
||||||
@group irc
|
@group bot
|
||||||
|
|
||||||
Configuring and extending the IRCBot.
|
Configuring and extending the chat bot.
|
||||||
|
|
||||||
= Overview =
|
= Overview =
|
||||||
|
|
||||||
Phabricator includes a simple IRC bot daemon, which is primarily intended as
|
Phabricator includes a simple chat bot daemon, which is primarily intended as
|
||||||
an example of how you can write an external script that interfaces with
|
an example of how you can write an external script that interfaces with
|
||||||
Phabricator over Conduit and does some kind of useful work. If you use IRC, you
|
Phabricator over Conduit and does some kind of useful work. If you use IRC or
|
||||||
can also have the bot hang out in your channel.
|
another supported chat protocol, you can also have the bot hang out in your
|
||||||
|
channel.
|
||||||
|
|
||||||
NOTE: The IRC bot is somewhat experimental and not very mature.
|
NOTE: The chat bot is somewhat experimental and not very mature.
|
||||||
|
|
||||||
= Configuring the Bot =
|
= Configuring the Bot =
|
||||||
|
|
||||||
The bot reads a JSON configuration file. You can find an example in:
|
The bot reads a JSON configuration file. You can find an example in:
|
||||||
|
|
||||||
resources/ircbot/example_config.json
|
resources/chatbot/example_config.json
|
||||||
|
|
||||||
These are the configuration values it reads:
|
These are the configuration values it reads:
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ These are the configuration values it reads:
|
||||||
- ##nickpass## String, optional, password for NickServ.
|
- ##nickpass## String, optional, password for NickServ.
|
||||||
- ##join## Array, list of channels to join.
|
- ##join## Array, list of channels to join.
|
||||||
- ##handlers## Array, list of handlers to run. These are like plugins for the
|
- ##handlers## Array, list of handlers to run. These are like plugins for the
|
||||||
IRCBot.
|
bot.
|
||||||
- ##conduit.uri##, ##conduit.user##, ##conduit.cert## Conduit configuration,
|
- ##conduit.uri##, ##conduit.user##, ##conduit.cert## Conduit configuration,
|
||||||
see below.
|
see below.
|
||||||
- ##notification.channels## Notification configuration, see below.
|
- ##notification.channels## Notification configuration, see below.
|
||||||
|
@ -38,27 +39,23 @@ These are the configuration values it reads:
|
||||||
= Handlers =
|
= Handlers =
|
||||||
|
|
||||||
You specify a list of "handlers", which are basically plugins or modules for
|
You specify a list of "handlers", which are basically plugins or modules for
|
||||||
the IRC bot. These are the default handlers available:
|
the bot. These are the default handlers available:
|
||||||
|
|
||||||
- @{class:PhabricatorIRCProtocolHandler} This handler implements the raw IRC
|
- @{class:PhabricatorBotObjectNameHandler} This handler looks for users
|
||||||
protocol (e.g., responding with PONG when the server sends PING). You should
|
|
||||||
probably leave it in the handler list unless you implement the protocol
|
|
||||||
details yourself in another handler.
|
|
||||||
- @{class:PhabricatorIRCObjectNameHandler} This handler looks for users
|
|
||||||
mentioning Phabricator objects like "T123" and "D345" in chat, looks them
|
mentioning Phabricator objects like "T123" and "D345" in chat, looks them
|
||||||
up, and says their name with a link to the object. Requires conduit.
|
up, and says their name with a link to the object. Requires conduit.
|
||||||
- @{class:PhabricatorIRCDifferentialNotificationHandler} This handler posts
|
- @{class:PhabricatorBotDifferentialNotificationHandler} This handler posts
|
||||||
notifications about changes to revisions to IRC to the channels listed in
|
notifications about changes to revisions to the channels listed in
|
||||||
##notification.channels##.
|
##notification.channels##.
|
||||||
- @{class:PhabricatorIRCLogHandler} This handler records chatlogs which can
|
- @{class:PhabricatorBotLogHandler} This handler records chatlogs which can
|
||||||
be browsed in the Phabricator web interface.
|
be browsed in the Phabricator web interface.
|
||||||
|
|
||||||
You can also write your own handlers, by extending
|
You can also write your own handlers, by extending
|
||||||
@{class:PhabricatorIRCHandler}.
|
@{class:PhabricatorBotHandler}.
|
||||||
|
|
||||||
= Conduit =
|
= Conduit =
|
||||||
|
|
||||||
Some handlers (e.g., @{class:PhabricatorIRCObjectNameHandler}) need to read data
|
Some handlers (e.g., @{class:PhabricatorBotObjectNameHandler}) need to read data
|
||||||
from Phabricator over Conduit, Phabricator's HTTP API. You can use this method
|
from Phabricator over Conduit, Phabricator's HTTP API. You can use this method
|
||||||
to allow other scripts or programs to access Phabricator's data from different
|
to allow other scripts or programs to access Phabricator's data from different
|
||||||
servers and in different languages.
|
servers and in different languages.
|
||||||
|
@ -81,7 +78,7 @@ Now the bot should be able to connect to Phabricator via Conduit.
|
||||||
|
|
||||||
The bot is a Phabricator daemon, so start it with ##phd##:
|
The bot is a Phabricator daemon, so start it with ##phd##:
|
||||||
|
|
||||||
./bin/phd launch ircbot <absolute_path_to_config_file>
|
./bin/phd launch pharicatorbot <absolute_path_to_config_file>
|
||||||
|
|
||||||
If you have issues you can try ##debug## instead of ##launch##, see
|
If you have issues you can try ##debug## instead of ##launch##, see
|
||||||
@{article:Managing Daemons with phd} for more information.
|
@{article:Managing Daemons with phd} for more information.
|
Loading…
Reference in a new issue