Skip to content

Bridging Discord and Pesterchum (with Matterbridge)

Dpeta edited this page Jan 23, 2023 · 2 revisions

Pesterchum is just an IRC client, so to connect Discord and Pesterchum you could use any Discord <---> IRC bridge. This is slightly complicated by Pesterchum's weird non-standard syntax/commands though.

A possible setup is via matterbridge, this is what I'm using for #republic, some relevant things to look at for that are:

The version of Matterbridge I use is slightly modified to let you use initials (with {INITIALS}) on Pesterchum's side, I've put that version up here: https://github.com/Dpeta/matterbridge-but-chummy/releases

Example matterbridge.toml

An example of a configuration for the version with {INITIALS}, the ReplaceMessages lines remove Pesterchum's commands/colors/syntax for the Discord side of the bridge.

[discord]
    [discord.mydiscord]
        Token="" # Put ur bot token here
        Server="" # picked from guilds the bot is connected to
        UseLocalAvatar=["irc"]
        RemoteNickFormat="{NICK}"
        # Map threads from other bridges on discord replies
        PreserveThreading=true 
        AutoWebhooks=true

[irc.myirc]
    Nick="nick" # <== change this
    NickServNick=""
    NickServPassword=""
    Server="irc.pesterchum.xyz:6697"
    UseTLS=true
    SkipTLSVerify=false
    RemoteNickFormat="<c=0,0,0>{INITIALS}: "
    IgnoreMessages="PESTERCHUM:.*"
    ReplaceMessages=[ ["</c>", ""], ["^<c=(.*?)>[A-Z]{2}: ", ""], ["<c=(.*?)>", ""], ["#([a-fA-F0-9]{6})|(#[a-fA-F0-9]{3})", ""], ["@everyone", "AT everyone"], ["@here", "AT here"] ]
    
[[gateway]]
    name="gateway"
    enable=true
    UseLocalAvatar=["discord.mydiscord", "irc.myirc"]
    
[[gateway.inout]]
    account="irc.myirc"
    channel="#channel" # <-- Pesterchum memo name

[[gateway.inout]]
    account="discord.mydiscord"
    channel="channel" # <-- Discord channel name

woo yeah woo yeah

discord

pchum