v1.2
Sneedchat-Discord Bridge
A high-performance bridge written in Go that synchronizes messages between Kiwi Farms Sneedchat and Discord, with full support for edits, deletes, embeds, attachments, and BBCode parsing.
Features
- ✅ Bidirectional message sync (Sneedchat ↔ Discord)
- ✅ Edit and delete synchronization
- ✅ Attachment uploads and BBcode formating via Litterbox
- ✅ BBCode → Markdown parsing
- ✅ Message queueing during outages
Performance
Typical resource usage:
- CPU: Efficient, easily handled by a Raspberry Pi, a few % on cpu usage at heavy load.
- Memory: 10-15 MB at full load in a busy channel
- Network: Minimal (< 1 MB/minute) except when uploading attachments
Requirements
- Go 1.23 or higher
- Discord Bot Token with proper permissions
- Discord Webhook URL
- Kiwi Farms account with Sneedchat access
Installation
1. Install Go (Debian)
# Install Go from package manager
sudo apt update
sudo apt install golang git
# Verify installation
go version # Should show 1.23 or higher
2. Clone and Build
# Create installation directory
cd /opt/sneedchat-bridge
# Clone repository
git clone [repository url].git
# Initialize Go module
go mod init sneedchat-discord-bridge
# Download dependencies
go mod tidy
# Build the binary
go build -o sneedchat-bridge
Launch using ./sneedchat-bridge --env .env
Discord Setup
Step 1: Create Discord Application
- Go to Discord Developer Portal
- Click "New Application"
- Name it (e.g., "Sneedchat Bridge")
- Click "Create"
Step 2: Create Bot
- In your application, go to "Bot" tab (left sidebar)
- Click "Add Bot" → "Yes, do it!"
- Under "TOKEN", click "Reset Token" → "Copy"
- ⚠️ Save this token - you'll need it for
DISCORD_BOT_TOKEN
- ⚠️ Save this token - you'll need it for
- Scroll down to "Privileged Gateway Intents":
- ✅ Enable "MESSAGE CONTENT INTENT"
- ✅ Enable "SERVER MEMBERS INTENT" (optional)
- Click "Save Changes"
Step 3: Invite Bot to Server
- Go to "OAuth2" → "URL Generator" tab
- Select SCOPES:
- ✅
bot - ✅
applications.commands(optional)
- ✅
- Select BOT PERMISSIONS:
- ✅
Read Messages/View Channels - ✅
Send Messages - ✅
Manage Messages(for edits/deletes) - ✅
Embed Links - ✅
Attach Files - ✅
Read Message History - ✅
Add Reactions(optional)
- ✅
- Copy the generated URL at bottom
- Open URL in browser and select your server
- Click "Authorize"
Step 4: Create Webhook
- In Discord, go to your server
- Right-click the channel you want to bridge
- Click "Edit Channel"
- Go to "Integrations" tab
- Click "Webhooks" → "New Webhook"
- Name it (e.g., "Sneedchat")
- Set avatar (optional)
- Click "Copy Webhook URL"
- ⚠️ Save this URL - you'll need it for
DISCORD_WEBHOOK_URL
- ⚠️ Save this URL - you'll need it for
Step 5: Get Channel and Guild IDs
- Enable Developer Mode in Discord:
- User Settings → Advanced → Developer Mode (toggle ON)
- Channel ID:
- Right-click the bridge channel → "Copy Channel ID"
- Guild ID (Server ID):
- Right-click server name → "Copy Server ID"
Configuration
Create Environment File
cd /opt/sneedchat-bridge
mv .env.example .env
To run multiple bridges (different rooms/channels):
Copy binary and create separate .env files, example .env.general, .env.keno-kasino and change the room integer found under SNEEDCHAT_ROOM_ID=16
Create separate systemd services with unique names
Important Notes:
- Replace
BRIDGE_USERNAMEwith your Kiwi Farms username (not email) SNEEDCHAT_ROOM_ID=1is the default Sneedchat room- Keep quotes out of values
- Don't share your
.envfile!
Fill in your values:
# Discord Configuration
DISCORD_BOT_TOKEN=YOUR_BOT_TOKEN_HERE
DISCORD_CHANNEL_ID=1234567890123456789
DISCORD_GUILD_ID=9876543210987654321
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/1234567890/AbCdEfGhIjKlMnOpQrStUvWxYz
# Sneedchat Configuration
SNEEDCHAT_ROOM_ID=1
BRIDGE_USERNAME=YourKiwiUsername
BRIDGE_PASSWORD=YourKiwiPassword
# Optional: Bridge user filtering (Used to prevent your messages echoing back to Discord and for queued messages during outages)
# Get your Kiwi user ID from profile URL
BRIDGE_USER_ID=12345
# Optional: Discord ping conversion
# Your Discord user ID (right-click yourself → Copy User ID)
DISCORD_PING_USER_ID=1234567890123456789
# Optional: Enable file logging
ENABLE_FILE_LOGGING=false
Set Permissions
# Secure the config file
sudo chmod 600 .env
sudo chown root:root .env
# Set binary permissions
sudo chmod 755 sneedchat-bridge
Watch for:
✅ Successfully fetched fresh cookie with xf_user
✅ Successfully connected to Sneedchat room 1
🤖 Discord bot ready: Sneedchat Bridge
🌉 Discord-Sneedchat Bridge started successfully
Press Ctrl+C to terminate bridge.
Systemd Service Setup:
Create Service File
sudo nano /etc/systemd/system/sneedchat-bridge.service
Paste this configuration:
[Unit]
Description=Sneedchat-Discord Bridge
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/sneedchat-bridge
ExecStart=/opt/sneedchat-bridge/sneedchat-bridge --env /opt/sneedchat-bridge/.env
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
# Security hardening (optional)
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Enable and Start Service
# Reload systemd
sudo systemctl daemon-reload
# Enable service (start on boot)
sudo systemctl enable sneedchat-bridge
# Start service now
sudo systemctl start sneedchat-bridge
# Check status
sudo systemctl status sneedchat-bridge
Troubleshooting
Cookie Issues
If you see xf_user cookie missing in stdout:
- Verify credentials - Try logging in manually on Kiwi Farms
- Check rate limits - KiwiFlare might be blocking you temporarily or is suffering DDOS attacks
- The bridge will retry indefinitely to acquire login cookie with exponential backoff in event of Kiwifarms outages.
Discord Permission Issues
If messages aren't appearing:
- Check bot has Read Messages and Send Messages in channel
- Verify webhook is for the correct channel
- Check channel isn't restricted to certain roles
Security Notes
- 🔐 Keep
.envfile secure (chmod 600) - 🔐 Rotate Discord bot token or Kiwifarms password if leaked
License
This bridge is provided as-is. Use responsibly and in accordance with Kiwi Farms and Discord Terms of Service.
Credits
Built with:
- discordgo - Discord API
- gorilla/websocket - WebSocket client
- godotenv - Environment loading
Description
A Go program to bridge a Kiwifarms Sneedchat channel to Discord via webhooks by puppeting a user account.
Releases
5
Release v1.3
Latest
Languages
Go
100%