Matterbridge

matterbrige is a bridge written in go, with support of many protocols and chat programs. in this guide, we will create a bridge from IRC to Telegram.

configuartion

first, download matterbridge binary from author's github

$ ftp https://github.com/42wim/matterbridge/releases/download/v1.20.0/matterbridge-1.20.0-openbsd-64bit

Note: due to a bug in newer version which lead to segfault, 1.20 is used

afterwards, create a bot at @botfather in telegram, choose a name for it and disable group privacy, add it to your supergroup and make IRCchannel. then fire up your editor and edit matterbridge.toml

[irc.ircbridge]
Server="example.com:6667"
Nick="BotNick"

first line defines a new bridge with name ircbridge, second line sets server and port to connect and last line sets BotNick for our bot

Note: currently, only plain-text is supported for IRC.

[telegram.telebridge]
Token="<token>"

first line will adds another bridge and replace <token> in second line with your bot token.

[gateway]
name="gateway"                                
enable=true

[[gateway.inout]]                                
account="irc.ircgateway"
channel="#channel"

[[gateway.inout]]
account="telegram.telegateway"
channel="-10012345678"

in first three lines defined our gateway with name "gateway", in next lines we have defined our IRC channel ( #channel) with irc.ircgateway bridge and our supergroup with telegateway. replace #channel and -10012345678 as your needs, note that telegram supergroups require -100 before their id.

then run chmod +x matterbridge-1.20.0-openbsd-64bit and ./matterbridge-1.20.0-openbsd-64bit

configuration file

[irc.ircbridge]
Server="example.com:6667"
Nick="BotNick"

[telegram.telebridge]
Token="<token>"

[gateway]
name="gateway"                                
enable=true

[[gateway.inout]]                                
account="irc.ircgateway"
channel="#channel"

[[gateway.inout]]
account="telegram.telegateway"
channel="-10012345678"

troubleshooting

sometimes running matterbridge with -d can help.

if you can send messages from IRC to telegram, but messages won't come from telegram to IRC, chances are you've not disabled group privacy in botfather.