enwnbot

Converts MediaWiki [[links]] and {{templates}} to links on IRC
git clone http://git.hanabi.in/repos/enwnbot.git
Log | Files | Refs | README | LICENSE

README.md (1486B)


      1 Converts MediaWiki [[links]] and {{templates}} to links.
      2 
      3 # Installation
      4 
      5 To run this project, run the following commands after cloning it.
      6 
      7 ```sh
      8 cd <DIR>
      9 yarn # or `npm i`
     10 yarn start # or `npm run start`
     11 ```
     12 
     13 # Configuration
     14 
     15 Use the `config.js` to configure the bot.
     16 
     17 - Specify the bot's IRC nick in `botName`. (eg. `linkBot`)
     18 - Mention the list of channels to monitor in `channels`.
     19 - Specify IRC channel in `server`. (eg. `irc.freenode.net`)
     20 - API should be specified in `URL`. (eg. `https://en.wikinews.org/w/index.php?title=`)
     21 
     22 Additionally, the bot reports any errors to its maintainers.
     23 
     24 - Mention the list of maintainers in the `maintainers` array.
     25 - PM to the bot will not be forwarded to anyone, unless it starts with a particular string mentioned in `report`. If the bot gets a PM which starts with `report`, it will forward the PM to a list of admins. **Note:** This could be abused, so specifying `report` as `/` might be a good idea.
     26 - Specify the list of admins who would like to receive PM of the forwarded message in `admins`.
     27 
     28 Sample `config.js` looks like:
     29 
     30 ```js
     31 const config = {
     32   admins: ['jdoe', 'samsmith'],
     33   botName: 'linkBot',
     34   channels: ['#foo', '##bar'],
     35   maintainers: ['list', 'of', 'maintainers'],
     36   report: '!ADMIN',
     37   server: 'irc.freenode.net',
     38   URL: 'https://en.wikinews.org/w/index.php?title=',
     39 };
     40 ```
     41 
     42 **Note:** In case if your message contains templates and you don't want the bot to announce the link -- add `--nl` at the end of the message.