{"id":13456248,"url":"https://github.com/reactiflux/discord-irc","last_synced_at":"2025-05-15T01:04:36.425Z","repository":{"id":39617260,"uuid":"44140591","full_name":"reactiflux/discord-irc","owner":"reactiflux","description":"Connects Discord and IRC channels by sending messages back and forth.","archived":false,"fork":false,"pushed_at":"2023-11-25T09:52:53.000Z","size":1254,"stargazers_count":1213,"open_issues_count":74,"forks_count":292,"subscribers_count":64,"default_branch":"main","last_synced_at":"2025-04-06T19:06:41.035Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reactiflux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-10-12T23:53:50.000Z","updated_at":"2025-04-05T12:10:15.000Z","dependencies_parsed_at":"2024-01-11T19:16:13.697Z","dependency_job_id":"eb84a9bf-0c0b-4235-a7df-1b4a0ab2bde5","html_url":"https://github.com/reactiflux/discord-irc","commit_stats":{"total_commits":517,"total_committers":45,"mean_commits":"11.488888888888889","dds":0.7891682785299807,"last_synced_commit":"b2e75985543cac7c445f01990a88c5f86ce90adc"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiflux%2Fdiscord-irc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiflux%2Fdiscord-irc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiflux%2Fdiscord-irc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiflux%2Fdiscord-irc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactiflux","download_url":"https://codeload.github.com/reactiflux/discord-irc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248784951,"owners_count":21161204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T08:01:18.578Z","updated_at":"2025-04-13T21:29:05.038Z","avatar_url":"https://github.com/reactiflux.png","language":"JavaScript","funding_links":[],"categories":["Misc Resources","JavaScript","Frameworks"],"sub_categories":["Bridges"],"readme":"[![Coverage Status](https://coveralls.io/repos/github/reactiflux/discord-irc/badge.svg?branch=main)](https://coveralls.io/github/reactiflux/discord-irc?branch=main)\n\n\u003e Connects [Discord](https://discord.com/) and [IRC](https://www.ietf.org/rfc/rfc1459.txt) channels by sending messages back and forth.\n\n## Example\n![discord-irc](http://i.imgur.com/oI6iCrf.gif)\n\n## Installation and usage\n**Note**: discord-irc requires Node.js version 12 or newer, as it depends on [discord.js](https://github.com/hydrabolt/discord.js).\nFuture versions may require newer Node.js versions, though we should support active releases.\n\nBefore you can run discord-irc you need to create a configuration file by\nfollowing the instructions [here](https://github.com/reactiflux/discord-irc#configuration).\nAfter you've done that you can replace `/path/to/config.json` in the commands\nbelow with the path to your newly created configuration file - or just `config.json` if it's\nin the same directory as the one you're starting the bot from.\n\nWhen you've done that you can install and start the bot either through npm:\n\n```bash\n$ npm install -g discord-irc\n$ discord-irc --config /path/to/config.json\n```\n\nor by cloning the repository:\n\n```bash\nIn the repository folder:\n$ npm install\n$ npm run build\n$ npm start -- --config /path/to/config.json # Note the extra double dash\n```\n\nIt can also be used as a module:\n```js\nimport discordIRC from 'discord-irc';\nimport config from './config.json';\ndiscordIRC(config);\n```\n\n## Docker\nAs an alternative to running discord-irc directly on your machine, we provide a [Docker container image](https://hub.docker.com/r/discordirc/discord-irc).\nAfter creating a configuration file, you can fetch the image from Docker Hub and run it with the following command:\n\n```bash\ndocker run -v /path/to/config:/config/config.json discordirc/discord-irc\n```\n\nIf you've checked out the repository already, you can build the Docker image locally and run that instead:\n\n```bash\ndocker build -t discord-irc .\ndocker run -v /path/to/config:/config/config.json discord-irc\n```\n\nNote that the path to the config file on the host (`/path/to/config`) _must_ be a valid absolute path to a config file.\nOtherwise, you may get the error \"illegal operation on a directory\".\n\n## Configuration\nFirst you need to create a Discord bot user, which you can do by following the instructions [here](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-\u0026-getting-a-token).\n\n### Example configuration\n```js\n[\n  // Bot 1 (minimal configuration):\n  {\n    \"nickname\": \"test2\",\n    \"server\": \"irc.testbot.org\",\n    \"discordToken\": \"botwantsin123\",\n    \"channelMapping\": {\n      \"#other-discord\": \"#new-irc-channel\"\n    }\n  },\n\n  // Bot 2 (advanced options):\n  {\n    \"nickname\": \"test\",\n    \"server\": \"irc.bottest.org\",\n    \"discordToken\": \"botwantsin123\",\n    \"autoSendCommands\": [ // Commands that will be sent on connect\n      [\"PRIVMSG\", \"NickServ\", \"IDENTIFY password\"],\n      [\"MODE\", \"test\", \"+x\"],\n      [\"AUTH\", \"test\", \"password\"]\n    ],\n    \"channelMapping\": { // Maps each Discord-channel to an IRC-channel, used to direct messages to the correct place\n      \"#discord\": \"#irc channel-password\", // Add channel keys after the channel name\n      \"1234567890\": \"#channel\" // Use a discord channel ID instead of its name (so you can rename it or to disambiguate)\n    },\n    \"ircOptions\": { // Optional node-irc options\n      \"floodProtection\": false, // On by default\n      \"floodProtectionDelay\": 1000, // 500 by default\n      \"port\": \"6697\", // 6697 by default\n      \"secure\": true, // enable SSL, false by default\n      \"sasl\": true, // false by default\n      \"username\": \"test\", // nodeirc by default\n      \"password\": \"p455w0rd\" // empty by default\n    },\n    \"format\": { // Optional custom formatting options\n      // Patterns, represented by {$patternName}, are replaced when sending messages\n      \"commandPrelude\": \"Command sent by {$nickname}\", // Message sent before a command\n      \"ircText\": \"\u003c{$displayUsername}\u003e {$text}\", // When sending a message to IRC\n      \"urlAttachment\": \"\u003c{$displayUsername}\u003e {$attachmentURL}\", // When sending a Discord attachment to IRC\n      \"discord\": \"**\u003c{$author}\u003e** {$withMentions}\", // When sending a message to Discord\n      // Other patterns that can be used:\n      // {$discordChannel} (e.g. #general)\n      // {$ircChannel} (e.g. #irc)\n      \"webhookAvatarURL\": \"https://robohash.org/{$nickname}\" // Default avatar to use for webhook messages\n    },\n    \"ircNickColor\": false, // Gives usernames a color in IRC for better readability (on by default)\n    \"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\n    \"parallelPingFix\": true, // Prevents users of both IRC and Discord from being mentioned in IRC when they speak in Discord (off by default)\n    // Makes the bot hide the username prefix for messages that start\n    // with one of these characters (commands):\n    \"commandCharacters\": [\"!\", \".\"],\n    \"ircStatusNotices\": true, // Enables notifications in Discord when people join/part in the relevant IRC channel\n    \"ignoreUsers\": {\n      \"irc\": [\"irc_nick1\", \"irc_nick2\"], // Ignore specified IRC nicks and do not send their messages to Discord.\n      \"discord\": [\"discord_nick1\", \"discord_nick2\"], // Ignore specified Discord nicks and do not send their messages to IRC.\n      \"discordIds\": [\"198528216523210752\"] // Ignore specified Discord ids and do not send their messages to IRC.\n    },\n    // List of webhooks per channel\n    \"webhooks\": {\n      \"#discord\": \"https://discord.com/api/webhooks/id/token\"\n    }\n  }\n]\n```\n\nThe `ircOptions` object is passed directly to irc-upd ([available options](https://node-irc-upd.readthedocs.io/en/latest/API.html#irc.Client)).\n\nTo retrieve a discord channel ID, write `\\#channel` on the relevant server – it should produce something of the form `\u003c#1234567890\u003e`, which you can then use in the `channelMapping` config.\n\n### Webhooks\nWebhooks lets you override nicknames and avatars, so messages coming from IRC\ncan appear as regular Discord messages:\n\n![discord-webhook](http://i.imgur.com/lNeJIUI.jpg)\n\nTo enable webhooks, follow part 1 of [this\nguide](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)\nto create and retrieve a webhook URL for a specific channel, then enable it in\ndiscord-irc's config as follows:\n\n```json\n  \"webhooks\": {\n    \"#discord-channel\": \"https://discord.com/api/webhooks/id/token\"\n  }\n```\n\n### Encodings\nIf you encounter trouble with some characters being corrupted from some clients (particularly umlauted characters, such as `ä` or `ö`), try installing the optional dependencies `iconv` and `node-icu-charset-detector`.\nThe bot will produce a warning when started if the IRC library is unable to convert between encodings.\n\nFurther information can be found in [the installation section of irc-upd](https://github.com/Throne3d/node-irc#character-set-detection).\n\n## Tests\nRun the tests with:\n```bash\n$ npm test\n```\n\n## Style Guide\ndiscord-irc follows the [Airbnb Style Guide](https://github.com/airbnb/javascript).\n[ESLint](http://eslint.org/) is used to make sure this is followed correctly, which can be run with:\n\n```bash\n$ npm run lint\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactiflux%2Fdiscord-irc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactiflux%2Fdiscord-irc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactiflux%2Fdiscord-irc/lists"}