diff --git a/resources/ircbot/example_config.json b/resources/chatbot/example_config.json similarity index 89% rename from resources/ircbot/example_config.json rename to resources/chatbot/example_config.json index 6dadec2952..670184eae0 100644 --- a/resources/ircbot/example_config.json +++ b/resources/chatbot/example_config.json @@ -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"] diff --git a/src/docs/technical/ircbot.diviner b/src/docs/technical/chatbot.diviner similarity index 70% rename from src/docs/technical/ircbot.diviner rename to src/docs/technical/chatbot.diviner index cb223eb262..54388157b5 100644 --- a/src/docs/technical/ircbot.diviner +++ b/src/docs/technical/chatbot.diviner @@ -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 + ./bin/phd launch pharicatorbot If you have issues you can try ##debug## instead of ##launch##, see @{article:Managing Daemons with phd} for more information.