Skip to content

Commit

Permalink
Merge pull request #222 from Throne3d/fix/docs
Browse files Browse the repository at this point in the history
Add documentation for Discord channel IDs and the custom formatting
  • Loading branch information
ekmartin authored Apr 14, 2017
2 parents 884f0ca + d877ae2 commit 8c3ad07
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,23 @@ First you need to create a Discord bot user, which you can do by following the i
["AUTH", "test", "password"]
],
"channelMapping": { // Maps each Discord-channel to an IRC-channel, used to direct messages to the correct place
"#discord": "#irc channel-password" // Add channel keys after the channel name
"#discord": "#irc channel-password", // Add channel keys after the channel name
"1234567890": "#channel" // Use a discord channel ID instead of its name (so you can rename it or to disambiguate)
},
"ircOptions": { // Optional node-irc options
"floodProtection": false, // On by default
"floodProtectionDelay": 1000 // 500 by default
},
"format": { // Optional custom formatting options
// Patterns, represented by {$patternName}, are replaced when sending messages
"commandPrelude": "Command sent by {$nickname}", // Message sent before a command
"ircText": "<{$displayUsername}> {$text}", // When sending a message to IRC
"urlAttachment": "<{$displayUsername}> {$attachmentURL}", // When sending a Discord attachment to IRC
"discord": "**<{$author}>** {$withMentions}" // When sending a message to Discord
// Other patterns that can be used:
// {$discordChannel} (e.g. #general)
// {$ircChannel} (e.g. #irc)
},
"ircNickColor": false, // Gives usernames a color in IRC for better readability (on by default)
// Makes the bot hide the username prefix for messages that start
// with one of these characters (commands):
Expand All @@ -81,6 +92,8 @@ First you need to create a Discord bot user, which you can do by following the i

The `ircOptions` object is passed directly to node-irc ([available options](http://node-irc.readthedocs.org/en/latest/API.html#irc.Client)).

To retrieve a discord channel ID, write `\#channel` on the relevant server – it should produce something of the form `<#1234567890>`, which you can then use in the `channelMapping` config.

## Tests
Run the tests with:
```bash
Expand Down

0 comments on commit 8c3ad07

Please sign in to comment.