matterbridge: Can not send Messages via Bridge with WhatsApp
Describe the bug I have a semi-working bridge connecting Telegram, Matrix, XMPP and Whatsapp… Receiving messages via bridge works for all. Sending messages via bridge only for Telegram, Matrix, XMPP
To Reproduce Create a Bridge between Whatsapp and Telegram, Matrix or XMPP
Expected behavior Messages sent with WhatsApp are sent via matterbridge.
Screenshots/debug logs In the logs you can see, that whatsapp receives messages (here send from matrix)
[0013] DEBUG whatsapp: [Send:bridge/whatsapp/whatsapp.go:350] => Sending config.Message{Text:"Für Whatsapp", Channel:"xxxx-xxxx@g.us", Username:"[matrix] @tommy: ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}(nil)}
But when typing a message in Whatsapp nothing appears in the log. The log file:
[0000] INFO router: [Start:gateway/router.go:66] Parsing gateway bridge
[0000] INFO router: [Start:gateway/router.go:75] Starting bridge: whatsapp.wabot
[0000] DEBUG whatsapp: [Connect:bridge/whatsapp/whatsapp.go:68] Connecting to WhatsApp..
[0000] DEBUG whatsapp: [Connect:bridge/whatsapp/whatsapp.go:77] WhatsApp connection successful
[0000] DEBUG whatsapp: [Connect:bridge/whatsapp/whatsapp.go:85] Restoring WhatsApp session..
[0001] DEBUG whatsapp: [Connect:bridge/whatsapp/whatsapp.go:96] Session restored successfully!
[0001] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0001] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0001] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0001] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0001] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0001] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0001] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0001] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0002] ERROR whatsapp: [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0002] INFO whatsapp: [joinChannels:bridge/bridge.go:77] whatsapp.wabot: joining xxxx-xxxx@g.us (ID: xxxx-xxxx@g.uswhatsapp.wabot)
[0002] INFO router: [Start:gateway/router.go:75] Starting bridge: xmpp.blabber
[0002] INFO xmpp: [Connect:bridge/xmpp/xmpp.go:41] Connecting blabber.im:5222
[0002] DEBUG whatsapp: [func1:bridge/whatsapp/whatsapp.go:126] Getting user avatars..
[0003] INFO xmpp: [Connect:bridge/xmpp/xmpp.go:47] Connection succeeded
[0003] INFO xmpp: [joinChannels:bridge/bridge.go:77] xmpp.blabber: joining bridge-test (ID: bridge-testxmpp.blabber)
[0003] INFO router: [Start:gateway/router.go:75] Starting bridge: matrix.privacytools
[0003] INFO matrix: [Connect:bridge/matrix/matrix.go:76] Connecting https://chat.privacytools.io
[0003] DEBUG xmpp: [handleXMPP:bridge/xmpp/xmpp.go:237] == Receiving xmpp.Chat{Remote:"bridge-test@conference.blabber.im", Type:"groupchat", Text:"", Subject:"", Thread:"", Ooburl:"", Oobdesc:"", ID:"", ReplaceID:"", Roster:xmpp.Roster(nil), Other:[]string{}, OtherElem:[]xmpp.XMLElement(nil), Stamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}
[0005] INFO matrix: [Connect:bridge/matrix/matrix.go:92] Connection succeeded
[0005] INFO matrix: [joinChannels:bridge/bridge.go:77] matrix.privacytools: joining #bridge-test:privacytools.io (ID: #bridge-test:privacytools.iomatrix.privacytools)
[0005] INFO router: [Start:gateway/router.go:75] Starting bridge: telegram.tgbot
[0005] INFO telegram: [Connect:bridge/telegram/telegram.go:46] Connecting
[0005] INFO telegram: [Connect:bridge/telegram/telegram.go:59] Connection succeeded
[0005] INFO telegram: [joinChannels:bridge/bridge.go:77] telegram.tgbot: joining -1001111111 (ID: -1001111111telegram.tgbot)
[0005] INFO main: [main:matterbridge.go:70] Gateway(s) started succesfully. Now relaying messages
[0012] DEBUG matrix: [handleEvent:bridge/matrix/matrix.go:282] == Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@tommy:privacytools.io", Type:"m.room.message", Timestamp:1608221994428, ID:"$YSovQFDQMU4JF6kUgY5Pkj9pHppkCqhmoLxAb0ajAfQ", RoomID:"!pWIPPSfgfrfCcMwsOo:privacytools.io", Redacts:"", Unsigned:map[string]interface {}{"age":1503}, Content:map[string]interface {}{"body":"Für Whatsapp", "msgtype":"m.text"}, PrevContent:map[string]interface {}(nil)}
[0012] DEBUG matrix: [handleEvent:bridge/matrix/matrix.go:342] <= Sending message from @tommy:privacytools.io on matrix.privacytools to gateway
[0012] DEBUG gateway: [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"Für Whatsapp", Channel:"#bridge-test:privacytools.io", Username:"tommy", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"$YSovQFDQMU4JF6kUgY5Pkj9pHppkCqhmoLxAb0ajAfQ", Extra:map[string][]interface {}(nil)} from matrix.privacytools (#bridge-test:privacytools.io) to xmpp.blabber (bridge-test)
[0012] DEBUG xmpp: [Send:bridge/xmpp/xmpp.go:76] => Receiving config.Message{Text:"Für Whatsapp", Channel:"bridge-test", Username:"[matrix] <tommy> ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}(nil)}
[0012] DEBUG xmpp: [Send:bridge/xmpp/xmpp.go:112] => Sending message config.Message{Text:"Für Whatsapp", Channel:"bridge-test", Username:"[matrix] <tommy> ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}(nil)}
[0012] DEBUG gateway: [SendMessage:gateway/gateway.go:491] mID xmpp.blabber: bvdoaatjcrc8r9087dg0
[0012] DEBUG gateway: [func1:gateway/gateway.go:481] => Send from matrix.privacytools (#bridge-test:privacytools.io) to xmpp.blabber (bridge-test) took 490.099µs
[0012] DEBUG gateway: [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"Für Whatsapp", Channel:"#bridge-test:privacytools.io", Username:"tommy", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"$YSovQFDQMU4JF6kUgY5Pkj9pHppkCqhmoLxAb0ajAfQ", Extra:map[string][]interface {}(nil)} from matrix.privacytools (#bridge-test:privacytools.io) to telegram.tgbot (-1001111111)
[0012] DEBUG telegram: [Send:bridge/telegram/telegram.go:73] => Receiving config.Message{Text:"Für Whatsapp", Channel:"-1001111111", Username:"(matrix) <tommy> ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}(nil)}
[0012] DEBUG telegram: [sendMessage:bridge/telegram/telegram.go:148] Using mode HTML - nick only
[0012] DEBUG xmpp: [handleXMPP:bridge/xmpp/xmpp.go:237] == Receiving xmpp.Chat{Remote:"bridge-test@conference.blabber.im/xmppbot", Type:"groupchat", Text:"[matrix] <tommy> Für Whatsapp", Subject:"", Thread:"", Ooburl:"", Oobdesc:"", ID:"bvdoaatjcrc8r9087dg0", ReplaceID:"", Roster:xmpp.Roster(nil), Other:[]string{"", ""}, OtherElem:[]xmpp.XMLElement{xmpp.XMLElement{XMLName:xml.Name{Space:"urn:xmpp:mam:tmp", Local:"archived"}, InnerXML:""}, xmpp.XMLElement{XMLName:xml.Name{Space:"urn:xmpp:sid:0", Local:"stanza-id"}, InnerXML:""}}, Stamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}
[0013] DEBUG gateway: [SendMessage:gateway/gateway.go:491] mID telegram.tgbot: 94
[0013] DEBUG gateway: [func1:gateway/gateway.go:481] => Send from matrix.privacytools (#bridge-test:privacytools.io) to telegram.tgbot (-1001111111) took 238.948811ms
[0013] DEBUG gateway: [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"Für Whatsapp", Channel:"#bridge-test:privacytools.io", Username:"tommy", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"$YSovQFDQMU4JF6kUgY5Pkj9pHppkCqhmoLxAb0ajAfQ", Extra:map[string][]interface {}(nil)} from matrix.privacytools (#bridge-test:privacytools.io) to whatsapp.wabot (xxxx-xxxx@g.us)
[0013] DEBUG whatsapp: [Send:bridge/whatsapp/whatsapp.go:300] => Receiving config.Message{Text:"Für Whatsapp", Channel:"xxxx-xxxx@g.us", Username:"[matrix] @tommy: ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}(nil)}
[0013] DEBUG whatsapp: [Send:bridge/whatsapp/whatsapp.go:350] => Sending config.Message{Text:"Für Whatsapp", Channel:"xxxx-xxxx@g.us", Username:"[matrix] @tommy: ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfeeff2af8505323, ext:12868891372, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}(nil)}
[0013] DEBUG gateway: [SendMessage:gateway/gateway.go:491] mID whatsapp.wabot: C678816355665A741857
[0013] DEBUG gateway: [func1:gateway/gateway.go:481] => Send from matrix.privacytools (#bridge-test:privacytools.io) to whatsapp.wabot (xxxx-xxxx@g.us) took 485.482934ms
[0093] DEBUG xmpp: [func1:bridge/xmpp/xmpp.go:210] PING
[0112] DEBUG whatsapp: [func1:bridge/whatsapp/whatsapp.go:138] Finished getting avatars..
[0183] DEBUG xmpp: [func1:bridge/xmpp/xmpp.go:210] PING
Environment (please complete the following information):
- OS: Ubuntu 20.04.1 LTS
- Matterbridge version: version: 1.20.0 1a5353d7
Additional context
[general]
#check https://github.com/42wim/matterbridge/wiki/Settings#general
#some options for general configs such as
LogFile="/var/log/matterbridge.log"
MediaDownloadPath="/var/www/bridge/upload"
MediaDownloadSize=5000000
[matrix.privacytools]
#Server is your homeserver (eg https://matrix.org)
Server="https://chat.privacytools.io"
#login/pass of your bot.
#Use a dedicated user for this and not your own!
#Messages sent from this user will not be relayed to avoid loops.
Login="bridge-bot"
Password=""
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
#Whether to send the homeserver suffix. eg ":matrix.org" in @username:matrix.org
#to other bridges, or only send "username".(true only sends username)
#OPTIONAL (default false)
NoHomeServerSuffix=false
[xmpp.blabber]
Server="blabber.im:5222"
#Jid your userid
Jid="bridge-bot@blabber.im"
Password=""
Muc="conference.blabber.im"
Nick="xmppbot"
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
[telegram.tgbot]
#See https://core.telegram.org/bots#6-botfather
#and https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau
Token=""
RemoteNickFormat="({PROTOCOL}) <{NICK}> "
MessageFormat="HTMLNick"
[whatsapp.wabot]
# Number you will use as a relay bot. Tip: Get some disposable sim card, don't rely on
# your own number.
Number=""
# First time that you login you will need to scan QR code, then credentials will be saved in
# a session file.
# If you won't set SessionFile then you will need to scan QR code on every restart.
# optional (by default the session is stored only in memory, till restarting matterbridge)
SessionFile="session-wa.gob"
# If your terminal is white we need to invert QR code in order for it to be scanned properly
# optional (default false)
QrOnWhiteTerminal=false
# Messages will be seen by other WhatsApp contacts as coming from the bridge.
# Original nick will be part of the message.
RemoteNickFormat="[{PROTOCOL}] @{NICK}: "
[[gateway]]
name="bridge"
enable=true
[[gateway.inout]]
account="xmpp.blabber"
channel="bridge-test"
[[gateway.inout]]
account="matrix.privacytools"
channel="#bridge-test:privacytools.io"
[[gateway.inout]]
account="telegram.tgbot"
channel="-100ID"
[[gateway.inout]]
account="whatsapp.wabot"
channel="xxxx-xxxx@g.us"
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 15 (5 by maintainers)
I’m newbie. Yesterday I set up for my first time a bridge Whatsapp<>Telegram and I had issues sending messages from WhatsApp to Telegram but not from Telegram to WhatsApp. In my case I discovered that WhatsApp web shows a notice about the new feature of auto-deleting messages 7 days old. This notice I think that is not yet supported by matterbridge. When I disabled this setting on my test group matterbridge begins running fine. Think about it, maybe is also your issue. (I my case, Winx64 and also v1.20 latest release)