Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Update README with better config examples (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
aronson committed Oct 15, 2023
1 parent 0fd6ace commit 3adb91f
Showing 1 changed file with 79 additions and 76 deletions.
155 changes: 79 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,83 +129,86 @@ First you need to create a Discord bot user, which you can do by following the i
### Example configuration

```jsonc
[
// Bot 1 (minimal configuration):
{
"nickname": "test2",
"server": "irc.testbot.org",
"discordToken": "botwantsin123",
"channelMapping": {
"#other-discord": "#new-irc-channel"
}
},

// Bot 2 (advanced options):
{
"nickname": "test",
"server": "irc.bottest.org",
"port": 6697,
"tls": true,
"discordToken": "botwantsin123",
"autoSendCommands": [
// Commands that will be sent on connect
["PRIVMSG", "NickServ", "IDENTIFY password"],
["MODE", "test", "+x"],
["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
"1234567890": "#channel" // Use a discord channel ID instead of its name (so you can rename it or to disambiguate)
},
"ircOptions": {
// Deno/irc options, see https://github.com/jeromeludmann/deno-irc/blob/main/API.md#options
"username": "test",
"password": "p455w0rd"
},
"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} [@{$discordUsername}]> {$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)
"webhookAvatarURL": "https://robohash.org/{$nickname}" // Default avatar to use for webhook messages
},
"ircNickColor": false, // Gives usernames a color in IRC for better readability (on by default)
"ircNickColors": [
"light_blue",
"dark_blue",
"light_red",
"dark_red",
"light_green",
"dark_green",
"magenta",
"light_magenta",
"orange",
"yellow",
"cyan",
"light_cyan"
], // Which irc-upd colors to use
"parallelPingFix": true, // Prevents users of both IRC and Discord from being mentioned in IRC when they speak in Discord (off by default)
// Makes the bot hide the username prefix for messages that start
// with one of these characters (commands):
"commandCharacters": ["!", "."],
"ircStatusNotices": true, // Enables notifications in Discord when people join/part in the relevant IRC channel
"ignoreUsers": {
"irc": ["irc_nick1", "irc_nick2"], // Ignore specified IRC nicks and do not send their messages to Discord.
"discord": ["discord_nick1", "discord_nick2"], // Ignore specified Discord nicks and do not send their messages to IRC.
"discordIds": ["198528216523210752"] // Ignore specified Discord ids and do not send their messages to IRC.
},
// List of webhooks per channel
"webhooks": {
"#discord": "https://discord.com/api/webhooks/id/token"
}
// Bot 1 (minimal configuration):
{
"nickname": "test",
"server": "irc.testbot.org",
"discordToken": "botwantsin123",
"channelMapping": {
"#other-discord": "#new-irc-channel"
}
]
}
```

```jsonc
// Bot 2 (advanced options, note some are conflicting):
{
"nickname": "test",
"server": "irc.bottest.org",
"port": 6697,
"tls": true,
"discordToken": "botwantsin123",
"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
"1234567890": "#channel" // Use a discord channel ID instead of its name (so you can rename it or to disambiguate)
},
"ircOptions": {
// Deno/irc options, see https://github.com/jeromeludmann/deno-irc/blob/main/API.md#options
"username": "test",
"password": "p455w0rd",
"floodDelay": 2000 // milliseconds to wait between messages to avoid flood, 1000-2000 is generally safe
},
"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} [@{$discordUsername}]> {$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)
"webhookAvatarURL": "https://robohash.org/{$nickname}" // Default avatar to use for webhook messages
},
"ircNickColor": true, // Gives usernames a color in IRC for better readability (on by default)
// Not including this property will use all the default colors
"ircNickColors": [
"light_blue",
"dark_blue",
"light_red",
"dark_red",
"light_green",
"dark_green",
"magenta",
"light_magenta",
"orange",
"yellow",
"cyan",
"light_cyan"
], // Which deno-irc colors to use
// Makes the bot hide the username prefix for messages that start
// with one of these characters (commands):
"commandCharacters": ["!", "."],
"ircStatusNotices": true, // Enables notifications in Discord when people join/part in the relevant IRC channel
"ignoreUsers": {
"irc": ["irc_nick1", "irc_nick2"], // Ignore specified IRC nicks and do not send their messages to Discord.
"discord": ["discord_nick1", "discord_nick2"], // Ignore specified Discord nicks and do not send their messages to IRC.
"discordIds": ["198528216523210752"] // Ignore specified Discord ids and do not send their messages to IRC.
},
// List of webhooks per channel
"webhooks": {
"#discord": "https://discord.com/api/webhooks/id/token"
},
// Commands that will be sent on connect
// Note: these are typically optional and only provided as a reference
"autoSendCommands": [
// NickServ is better handled by ircOptions.password
["PRIVMSG", "NickServ", "IDENTIFY password"],
["MODE", "test", "+x"],
["AUTH", "test", "password"]
]
}
```

The `ircOptions` object is passed directly to deno/irc
Expand Down

0 comments on commit 3adb91f

Please sign in to comment.