FKLC / WhatsAppToDiscord

WhatsAppToDiscord is a Discord bot that uses WhatsApp Web as a bridge between Discord and WhatsApp.
https://fklc.github.io/WhatsAppToDiscord/
MIT License
238 stars 67 forks source link

How can I modify the channel in the chats file? #147

Closed JasperTheMinecraftDev closed 1 year ago

JasperTheMinecraftDev commented 1 year ago

Tried to modify it but it crashes as the webhook is gone.

How can I change the webhook? Can't find that in the JSON file. And is there a better/official way to do it?

FKLC commented 1 year ago

Depends on what you mean by modifying it. What are you trying to do? To add/repair a channel, this is the schema.

"number/groupJid/status@s.whatsapp.net/g.us/broadcast": {
    "id": "webhook id",
    "type": "Incoming",
    "token": "webhook token",
    "channelId": "channel id of the conversation"
  }

If you want to use an already existing channel as a chat channel, the easiest way would be to start a new conversation, then stop the bot so that the chat will be saved to chats. This way you'll get jid of the group. Then go back to old channel that you want to use, and right click > Edit Channel > Integrations > Webhooks

This should be all. Just start the back again, and it should start working.

JasperTheMinecraftDev commented 1 year ago

Ah, so ID is the webhook? I changed the channel ID.

EDIT: Yeah, I'm trying to use a existing one.

FKLC commented 1 year ago

yeah, ID is the webhook ID and channel id is the channel id. you can't get the previous webhooks token, that's why we create a new webhook. the old one won't work.