mautrix / whatsapp

A Matrix-WhatsApp puppeting bridge
https://maunium.net/go/mautrix-whatsapp
GNU Affero General Public License v3.0
1.23k stars 170 forks source link

How to use relaybot #131

Closed vmario89 closed 3 years ago

vmario89 commented 4 years ago

Hi, actually i try to use this relaying thing discussed earlier but i do not understand /find out in code, how to really use this thing

What i did so far:

I do not understand the exact purpose of "invites" in config.yaml

20 and #46 point to this questions. I have a matrix user which is connected to our associations Whatsapp Business account by using the qr code provided "!wa login" to authenticate and login. I want to relay that WhatsApp account's rooms/messages to a bunch of other matrix users. So they should see the messages of the old/new incoming chats and maybe have the possibility to react to those messages. Thats how i understand this relaying function right now.

Could you please explain some short mini tutorial how to do that with the new relaybot? I have no idea how to continue setting it up at the moment :-(

regards and happy new year, Mario

pink-ok commented 4 years ago

Hi, settings in config.yaml for relaybot, find

relaybot:
enabled: true // relaybot activation
managament: 'id room: domain' // control room where commands can be sent from (moreover, with proper configuration permissions  several users can do it) ! wa help,! wa login, etc.
invites: ['@id user: domain', '@id user2: domain']  // invite matrix users which whatsapp bridge will add to their rooms, separated by commas
topikuning commented 3 years ago

try relaybot, keep disconnected after pairing. riot said: "Failed to connect to WhatsApp: unpaired from phone. To re-pair your phone, use delete-session and then login."

console said `panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x87a128]

goroutine 406 [running]: github.com/Rhymen/go-whatsapp.(Conn).encryptBinaryMessage(0xc000678000, 0xdd49ee, 0x6, 0xc0005c9e30, 0xca7440, 0xc000417980, 0x7f2ce81e0108, 0x8, 0x18, 0xc000417980, ...) /builds/tulir/mautrix-whatsapp/.cache/pkg/mod/github.com/tulir/go-whatsapp@v0.3.7/write.go:152 +0x88 github.com/Rhymen/go-whatsapp.(Conn).writeBinary(0xc000678000, 0xdd49ee, 0x6, 0xc0005c9e30, 0xca7440, 0xc000417980, 0xc000028010, 0xc00020b220, 0x14, 0x0, ...) /builds/tulir/mautrix-whatsapp/.cache/pkg/mod/github.com/tulir/go-whatsapp@v0.3.7/write.go:50 +0xe8 github.com/Rhymen/go-whatsapp.(Conn).sendProto(0xc000678000, 0xc0002087e0, 0x49453c, 0xc0003bbb90, 0x13a4fc0) /builds/tulir/mautrix-whatsapp/.cache/pkg/mod/github.com/tulir/go-whatsapp@v0.3.7/message.go:123 +0x238 github.com/Rhymen/go-whatsapp.(Conn).SendRaw(0xc000678000, 0xc0002087e0, 0xc0005b3c80) /builds/tulir/mautrix-whatsapp/.cache/pkg/mod/github.com/tulir/go-whatsapp@v0.3.7/message.go:29 +0x55 created by main.(*Portal).HandleMatrixMessage /builds/tulir/mautrix-whatsapp/portal.go:1965 +0x2ad`

tulir commented 3 years ago

There have been relaybot instructions in the docs for some time now

celevra commented 3 years ago

@tulir can you point me to these docs google didn't really helped me out

edit: https://docs.mau.fi/bridges/go/whatsapp/relaybot.html