this repo has no description
1# IRC <> Slack bridge
2
3This is a little bot in active development to bridge slack and irc for Hackclub!
4
5## How do I hack on it?
6
7### Development
8
9This is written in typescript so pretty easy to get started!
10
11```bash
12bun install
13bun dev
14```
15
16### Slack App Setup
17
181. Go to [api.slack.com/apps](https://api.slack.com/apps) and create a new app
192. Choose "From an app manifest"
203. Copy the contents of `slack-manifest.yaml` and paste it
214. Install the app to your workspace
225. Copy the "Bot User OAuth Token" (starts with `xoxb-`) and "Signing Secret"
236. Invite the bot to your desired Slack channel: `/invite @IRC Bridge`
24
25### Environment Setup
26
27Make a `.env` file with the following:
28
29```bash
30# Slack Configuration
31SLACK_BOT_TOKEN=xoxb-your-bot-token-here
32SLACK_SIGNING_SECRET=your-signing-secret-here
33
34# IRC Configuration
35IRC_NICK=slackbridge
36
37# Admin users (comma-separated Slack user IDs)
38ADMINS=U1234567890
39
40# Server Configuration (optional)
41PORT=3000
42```
43
44See `.env.example` for a template.
45
46### Managing Channel and User Mappings
47
48Channel and user mappings are stored in a SQLite database (`bridge.db`). You can manage them through:
49
50**Using Bun REPL:**
51```bash
52bun repl
53> import { channelMappings, userMappings } from "./src/db"
54> channelMappings.create("C1234567890", "#general")
55> userMappings.create("U1234567890", "myircnick")
56> channelMappings.getAll()
57```
58
59**Using SQLite directly:**
60```bash
61bun:sqlite bridge.db
62sqlite> SELECT * FROM channel_mappings;
63sqlite> INSERT INTO channel_mappings (slack_channel_id, irc_channel) VALUES ('C1234567890', '#general');
64```
65
66### How it works
67
68The bridge connects to `irc.hackclub.com:6667` (no TLS) and forwards messages bidirectionally based on channel mappings:
69
70- **IRC → Slack**: Messages from mapped IRC channels appear in their corresponding Slack channels
71- **Slack → IRC**: Messages from mapped Slack channels are sent to their corresponding IRC channels
72- User mappings allow custom IRC nicknames for specific Slack users
73
74The bridge ignores its own messages and bot messages to prevent loops.
75
76If you want to report an issue the main repo is [the tangled repo](https://tangled.org/dunkirk.sh/irc-slack-bridge) and the github is just a mirror.
77
78<p align="center">
79 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />
80</p>
81
82<p align="center">
83 © 2025-present <a href="https://github.com/taciturnaxolotl">Kieran Klukas</a>
84</p>
85
86<p align="center">
87 <a href="https://github.com/taciturnaxolotl/irc-slack-bridge/blob/main/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a>
88</p>