@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+18 -23
-2
resources/ircbot/example_config.json resources/chatbot/example_config.json
··· 6 6 "#phabot-test" 7 7 ], 8 8 "handlers" : [ 9 - "PhabricatorIRCProtocolHandler", 10 9 "PhabricatorBotObjectNameHandler", 11 10 "PhabricatorBotSymbolHandler", 12 11 "PhabricatorBotLogHandler", ··· 20 19 "conduit.cert" : null, 21 20 22 21 "macro.size" : 48, 23 - "macro.sleep" : 0.25, 24 22 "macro.aspect" : 0.66, 25 23 26 24 "notification.channels" : ["#phabot-test"]
+18 -21
src/docs/technical/ircbot.diviner src/docs/technical/chatbot.diviner
··· 1 - @title IRCBot Technical Documentation 2 - @group irc 1 + @title Chat Bot Technical Documentation 2 + @group bot 3 3 4 - Configuring and extending the IRCBot. 4 + Configuring and extending the chat bot. 5 5 6 6 = Overview = 7 7 8 - Phabricator includes a simple IRC bot daemon, which is primarily intended as 8 + Phabricator includes a simple chat bot daemon, which is primarily intended as 9 9 an example of how you can write an external script that interfaces with 10 - Phabricator over Conduit and does some kind of useful work. If you use IRC, you 11 - can also have the bot hang out in your channel. 10 + Phabricator over Conduit and does some kind of useful work. If you use IRC or 11 + another supported chat protocol, you can also have the bot hang out in your 12 + channel. 12 13 13 - NOTE: The IRC bot is somewhat experimental and not very mature. 14 + NOTE: The chat bot is somewhat experimental and not very mature. 14 15 15 16 = Configuring the Bot = 16 17 17 18 The bot reads a JSON configuration file. You can find an example in: 18 19 19 - resources/ircbot/example_config.json 20 + resources/chatbot/example_config.json 20 21 21 22 These are the configuration values it reads: 22 23 ··· 30 31 - ##nickpass## String, optional, password for NickServ. 31 32 - ##join## Array, list of channels to join. 32 33 - ##handlers## Array, list of handlers to run. These are like plugins for the 33 - IRCBot. 34 + bot. 34 35 - ##conduit.uri##, ##conduit.user##, ##conduit.cert## Conduit configuration, 35 36 see below. 36 37 - ##notification.channels## Notification configuration, see below. ··· 38 39 = Handlers = 39 40 40 41 You specify a list of "handlers", which are basically plugins or modules for 41 - the IRC bot. These are the default handlers available: 42 + the bot. These are the default handlers available: 42 43 43 - - @{class:PhabricatorIRCProtocolHandler} This handler implements the raw IRC 44 - protocol (e.g., responding with PONG when the server sends PING). You should 45 - probably leave it in the handler list unless you implement the protocol 46 - details yourself in another handler. 47 - - @{class:PhabricatorIRCObjectNameHandler} This handler looks for users 44 + - @{class:PhabricatorBotObjectNameHandler} This handler looks for users 48 45 mentioning Phabricator objects like "T123" and "D345" in chat, looks them 49 46 up, and says their name with a link to the object. Requires conduit. 50 - - @{class:PhabricatorIRCDifferentialNotificationHandler} This handler posts 51 - notifications about changes to revisions to IRC to the channels listed in 47 + - @{class:PhabricatorBotDifferentialNotificationHandler} This handler posts 48 + notifications about changes to revisions to the channels listed in 52 49 ##notification.channels##. 53 - - @{class:PhabricatorIRCLogHandler} This handler records chatlogs which can 50 + - @{class:PhabricatorBotLogHandler} This handler records chatlogs which can 54 51 be browsed in the Phabricator web interface. 55 52 56 53 You can also write your own handlers, by extending 57 - @{class:PhabricatorIRCHandler}. 54 + @{class:PhabricatorBotHandler}. 58 55 59 56 = Conduit = 60 57 61 - Some handlers (e.g., @{class:PhabricatorIRCObjectNameHandler}) need to read data 58 + Some handlers (e.g., @{class:PhabricatorBotObjectNameHandler}) need to read data 62 59 from Phabricator over Conduit, Phabricator's HTTP API. You can use this method 63 60 to allow other scripts or programs to access Phabricator's data from different 64 61 servers and in different languages. ··· 81 78 82 79 The bot is a Phabricator daemon, so start it with ##phd##: 83 80 84 - ./bin/phd launch ircbot <absolute_path_to_config_file> 81 + ./bin/phd launch pharicatorbot <absolute_path_to_config_file> 85 82 86 83 If you have issues you can try ##debug## instead of ##launch##, see 87 84 @{article:Managing Daemons with phd} for more information.