# New SweeBridge
SweeZero's own chat relay/bridge.
[Discourse Post](https://discuss.swee.codes/t/get-ready-for-a-new-sweebridge/56) announcing New SweeBridge
[Wiki Post](https://wiki.swee.codes/wiki/SweeBridge) on SweeBridge
> Dev note: I can't believe a dedicated bridge for SweeZero between Guilded and Libera.Chat became something so big like this :o
## To-Do:
* [ ] Clean up code a ***bit*** (which I'm too lazy to)
* [x] Matrix support
* [ ] Revolt support
* [ ] Discourse support
* [ ] Add Web Dashboard/Control
* [ ] Allow control if you're an operator/admin of the channel/server
* [ ] AnthroChat support
* [ ] SnooNet support
* [ ] OFTC support (Requested by [Depresst0](/Depresst0))
* [x] SweeNet support
* [ ] Freenode support (Requested by Mintle on IRC Libera chat)
* [ ] Irc-Nerds support (Requested by Mintle on IRC Libera chat)
* [ ] Add support for adding custom IRC nets
## Current platforms:
* IRC
* [Libera.Chat](https://libera.chat)
* [SweeNet](https://ircat.xyz/try.html)
* Discord
* Guilded
## Requirements of software:
* Python 3
* [Discord.Py](https://discordpy.readthedocs.io/en/stable/intro.html)
* [Guilded.Py](https://guildedpy.readthedocs.io/en/stable/gettingstarted.html)
* [Matrix-nio](https://github.com/matrix-nio/matrix-nio)
* [Python Requests](https://pypi.org/project/requests/)
* A [ZNC instance](https://wiki.znc.in) running on localhost (127.0.0.1) at port 5000
> [!WARNING]
>
> The user running SweeBridge must have read+write access to /var/www/html/sweebridge
> And /var/cache
>
> For matrix images to render, a web server should be setup pointing to /var/www/html/sweebridge (the website path can be set as shown in the environment variable listed below)
## Required enviroment variables:
```bash
LiberaNick=SweeBridge
LiberaUser=BridgeUser/Libera # for use in ZNC
SweeNetNick=SweeBridge
SweeNetUser=BridgeUser/SweeNet # for use in ZNC
MatrixHomeserver=https://matrix.example.com
# Use the real client API host, not the host with /.well-known/matrix
# If it's running on a different port, you can use https://matrix.example.com:8008/
# I recommend using a custom homeserver instead of matrix.org
# SSL is required
MatrixUserID=@sweebridge:matrix.example.com
MatrixToken=syi_***
MatrixFileCollectURL=https://sweebridge.example.com/ # URL must end with /
ZNCPassword=password # for use in ZNC
DiscordToken=token
GuildedToken=token
```
## Required `config.json`
```json
{
"sbconfig": {
"CommunityName": {
"discord": {
"guild": guild_id,
"channel": channel_id,
"webhook": "webhook_url"
},
"guilded": {
"server": "server_id",
"channel": "channel_id",
"webhook": "webhook_url"
},
"libera": {
"channel": "#channel",
"flags": {
"nosystem": "disable"
}
},
"sweenet": {
"channel": "#channel",
"flags": {
"nosystem": "full"
}
},
"matrix": {
"room": "!room_ID:matrix.example.com"
}
}
}
}
```
> [!TIP]
> ## (IRC) `nosystem` values:
>
> * `disable` - Show all system messages
> * `partial` - Only show Quit, Part, and Join messages
> * `full` - NO system messages, only user messages
>
> ## (Matrix) Use room IDs (`!ID:Homeserver`)
>
> AFAIK, matrix-nio can only use room IDs, so using public handles `#room:matrix.example.com` will not be supported.
## Get your community bridged with Default SweeBridge
1. Invite SweeBridge
Discord: [Link](https://discord.com/oauth2/authorize?client_id=1269419550605316166&permissions=8&integration_type=0&scope=bot)
Guilded: [Link](https://www.guilded.gg/b/7db35ab7-17aa-4d00-806d-3e8a53f65390)
Matrix: `/invite @bridge:swee.codes` while you're in the desired channel
IRC: `/invite sweeBridge #channel`
2. Create webhooks (Discord and Guilded)
~~Webhook guide is in [SWEE.codes wiki.](https://wiki.swee.codes/wiki/SweeBridge#Configuration)~~
You can now create webhooks using `b$createwebhook`
3. Contact Swee
The easiest ways would be checking [Swee's Social Links](https://swee.codes/links) or emailing [meow@swee.codes](mailto:meow@swee.codes)
## Communities bridged with SweeBridge
---
> [SweeZero](https://zero.swee.codes) - All platforms supported with SweeBridge are bridged here
>
> MintleChats - [Discord](https://discord.gg/5kmatqaYn9) <-> [Libera.Chat](ircs://irc.libera.chat:6697/#cafeteria)
>
> Bacon Hair Community (BHC) - Discord, [Guilded](https://guilded.gg/BHC), [Libera.Chat](https://swee.codes/u/bhcirc), Matrix