1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +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:
epriestley 2013-02-14 12:47:39 -08:00
parent 73991bb262
commit 1e5d1f6534
2 changed files with 18 additions and 23 deletions

View file

@ -6,7 +6,6 @@
"#phabot-test"
],
"handlers" : [
"PhabricatorIRCProtocolHandler",
"PhabricatorBotObjectNameHandler",
"PhabricatorBotSymbolHandler",
"PhabricatorBotLogHandler",
@ -20,7 +19,6 @@
"conduit.cert" : null,
"macro.size" : 48,
"macro.sleep" : 0.25,
"macro.aspect" : 0.66,
"notification.channels" : ["#phabot-test"]

View file

@ -1,22 +1,23 @@
@title IRCBot Technical Documentation
@group irc
@title Chat Bot Technical Documentation
@group bot
Configuring and extending the IRCBot.
Configuring and extending the chat bot.
= 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
Phabricator over Conduit and does some kind of useful work. If you use IRC, you
can also have the bot hang out in your channel.
Phabricator over Conduit and does some kind of useful work. If you use IRC or
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 =
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:
@ -30,7 +31,7 @@ These are the configuration values it reads:
- ##nickpass## String, optional, password for NickServ.
- ##join## Array, list of channels to join.
- ##handlers## Array, list of handlers to run. These are like plugins for the
IRCBot.
bot.
- ##conduit.uri##, ##conduit.user##, ##conduit.cert## Conduit configuration,
see below.
- ##notification.channels## Notification configuration, see below.
@ -38,27 +39,23 @@ These are the configuration values it reads:
= Handlers =
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
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
- @{class:PhabricatorBotObjectNameHandler} This handler looks for users
mentioning Phabricator objects like "T123" and "D345" in chat, looks them
up, and says their name with a link to the object. Requires conduit.
- @{class:PhabricatorIRCDifferentialNotificationHandler} This handler posts
notifications about changes to revisions to IRC to the channels listed in
- @{class:PhabricatorBotDifferentialNotificationHandler} This handler posts
notifications about changes to revisions to the channels listed in
##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.
You can also write your own handlers, by extending
@{class:PhabricatorIRCHandler}.
@{class:PhabricatorBotHandler}.
= 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
to allow other scripts or programs to access Phabricator's data from different
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##:
./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
@{article:Managing Daemons with phd} for more information.