GithubHelp home page GithubHelp logo

fklc / whatsapptodiscord Goto Github PK

View Code? Open in Web Editor NEW
223.0 16.0 65.0 1.04 MB

WhatsAppToDiscord is a Discord bot that uses WhatsApp Web as a bridge between Discord and WhatsApp.

Home Page: https://fklc.github.io/WhatsAppToDiscord/

License: MIT License

JavaScript 98.64% Shell 1.05% Dockerfile 0.31%
whatsapp-web discord-bot discordgo whatsapp discord bot discord-js javascript

whatsapptodiscord's Introduction

WhatsApp To Discord

WhatsAppToDiscord is a Discord bot that uses WhatsApp Web as a bridge between Discord and WhatsApp. It is built on top of discord.js and Baileys libraries.

Features

  • Supports media (Image, Video, Audio, Document, Stickers) and reactions!
  • Allows whitelisting, so you can choose what to see on Discord
  • Allows usage of WhatsApp through the Discord overlay
  • It uses less memory as it doesn't simulate a browser
  • Open Source, you can see, modify and run your own version of the bot!
  • Self Hosted, so your data never leaves your computer

For setup and commands, check out the documentation!

whatsapptodiscord's People

Contributors

fklc avatar raphazappa avatar theassemblerguy avatar vishalpj14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whatsapptodiscord's Issues

The bot is unresponsive to the commands

Sorry to reach out to you in that way!
I am struggling with the features advertised.

I just installed everything and I can receive messages, but where can I use the commands? The console does not accept any, and in the control-room my commands would not be recognized. Am I missing anything?

Only certain groups/messages

Not an issue per se, but I wanted to know if there's a way I can make this only pull messages from particular chats (i.e., groups or DMs) only.

Crashes & Delete chat problem

log.Panicln(0xc0000c3c88, 0x1, 0x1)
        log/log.go:365 +0xb7
main.handlePanic(...)
        command-line-arguments/WA2DC.go:735
main.getOrCreateChannel(0x9d0635, 0xf, 0x0)
        command-line-arguments/WA2DC.go:617 +0x1e5
main.dcCommandStart(0xc0001dac30, 0x3, 0x3)
        command-line-arguments/WA2DC.go:251 +0x35d
main.dcOnMessageCreate(0xc0000dab40, 0xc0003000f0)
        command-line-arguments/WA2DC.go:212 +0x372
github.com/bwmarrin/discordgo.messageCreateEventHandler.Handle(0x9ee8f8, 0xc0000dab40, 0x944400, 0xc0003000f0)
        github.com/bwmarrin/[email protected]/eventhandlers.go:497 +0x52
created by github.com/bwmarrin/discordgo.(*Session).handle
        github.com/bwmarrin/[email protected]/event.go:171 +0x118
Bot is now running. Press CTRL-C to exit.
  1. Still crashing giving this error
  2. Is there a way to fix the fact that it deletes all my chats whenever it crashes?

Executing via cmd

image

Crash after add the webwhatsapp session on the device

Using Windows 10 Server

Sync messages to Discord channel

Hi there, im a beginner in coding tbh. I've been working on a Discord server lately and I needed a script to bring one of my whatsapp groups to one of my server channel. You have done a really great job with this script mate. As of registering this issue i have one problem with your script. Im having to run the bot locally due to which it cannot be online 24/7. The messages that are sent while the script is not running are not synced back to the channel when i start the script again. I request you to try to make it so that the old messages get synced when i run the script. Please let me know whether it is possible.

Yours sincerely,
Hyper Smartian

Would it be possible to tweak it a bit?

Im using this at the moment for a bridge between our whatsapp class and our discord class group.
Would it be possible that messages from users in the discord appear in front of the message (Like [DAM] Hi)?

Load/Sync old messages

is it possible to load all the messages that were sent previously from a WhatsApp group?

WA2DC Window Closed

When the WA2DC window it's closed the bot stops working. Still the bot works fantastic.

Messages get deleted on reconnection

Hi there, so I was playing around with your tool. I discovered that every time the session times out, all chats are gone. Is that intended behaviour? Or is my bot missing some permissions?

Session couldt restored.

Session couldn't restored. error decoding login connResp: json: cannot unmarshal array into Go value of type map[string]interface {}
. Going to create a new session!

panic: HTTP 413 Request Entity Too Large

Hi there,

This is a new kind of error that I keep on receiving since yesterday. Here the log

2020-12-24T13:12:12.436624+00:00 app[worker.1]: [heroku-exec] Starting
2020-12-24T13:12:51.371350+00:00 app[worker.1]: Bot is now running. Press CTRL-C to exit.
2020-12-24T13:13:28.883370+00:00 app[worker.1]: error processing data: received invalid data
2020-12-24T13:13:32.690223+00:00 app[worker.1]: error processing data: received invalid data
2020-12-24T13:13:34.612351+00:00 app[worker.1]: error processing data: received invalid data
2020-12-24T13:50:43.751748+00:00 app[worker.1]: panic: HTTP 413 Request Entity Too Large, {"message": "Request entity too large", "code": 40005}
2020-12-24T13:50:43.751760+00:00 app[worker.1]: 
2020-12-24T13:50:43.751799+00:00 app[worker.1]: goroutine 1403 [running]:
2020-12-24T13:50:43.751810+00:00 app[worker.1]: main.handleMediaMessage(0xc002b505a0, 0x20, 0xc002b504e0, 0x1d, 0x0, 0x0, 0x0, 0x5fe49cb1, 0x0, 0x0, ...)
2020-12-24T13:50:43.751811+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:450 +0x6fc
2020-12-24T13:50:43.751839+00:00 app[worker.1]: main.waHandler.HandleVideoMessage(0xc002b505a0, 0x20, 0xc002b504e0, 0x1d, 0x0, 0x0, 0x0, 0x5fe49cb1, 0x0, 0x0, ...)
2020-12-24T13:50:43.751855+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:475 +0x1da
2020-12-24T13:50:43.751871+00:00 app[worker.1]: created by github.com/Rhymen/go-whatsapp.(*Conn).handleWithCustomHandlers
2020-12-24T13:50:43.751887+00:00 app[worker.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/!rhymen/[email protected]/handler.go:222 +0x1068
2020-12-24T13:50:43.806782+00:00 heroku[worker.1]: Process exited with status 2
2020-12-24T13:50:43.845819+00:00 heroku[worker.1]: State changed from up to crashed
2020-12-24T13:50:43.849375+00:00 heroku[worker.1]: State changed from crashed to starting
2020-12-24T13:50:44.961847+00:00 heroku[worker.1]: Starting process with command `bin/WhatsAppToDiscord`
2020-12-24T13:50:45.660477+00:00 heroku[worker.1]: State changed from starting to up
2020-12-24T13:50:48.829393+00:00 app[worker.1]: [heroku-exec] Starting
2020-12-24T13:55:52.568543+00:00 app[worker.1]: panic: interface conversion: interface {} is nil, not string
2020-12-24T13:55:52.575503+00:00 app[worker.1]: 
2020-12-24T13:55:52.585066+00:00 app[worker.1]: goroutine 1 [running]:
2020-12-24T13:55:52.585796+00:00 app[worker.1]: github.com/Rhymen/go-whatsapp.(*Conn).Login(0xc000448ee0, 0xc000225ec0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2020-12-24T13:55:52.585994+00:00 app[worker.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/!rhymen/[email protected]/session.go:234 +0x23cf
2020-12-24T13:55:52.586103+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.586284+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:344 +0x11c
2020-12-24T13:55:52.586412+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.586615+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.586698+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.586927+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.586992+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.587228+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.587327+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.587491+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.587622+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.587843+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.587905+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.588127+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.588197+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.588379+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.588462+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.588647+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.588729+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.588919+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.589003+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.589190+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.589274+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.589465+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.589567+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.589736+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.589838+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.590013+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.590117+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.590286+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:347 +0x267
2020-12-24T13:55:52.590387+00:00 app[worker.1]: main.connectToWhatsApp()
2020-12-24T13:55:52.590554+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:325 +0x4d1
2020-12-24T13:55:52.590656+00:00 app[worker.1]: main.initializeWhatsApp()
2020-12-24T13:55:52.590830+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:312 +0xc4
2020-12-24T13:55:52.590933+00:00 app[worker.1]: main.main()
2020-12-24T13:55:52.591127+00:00 app[worker.1]: /tmp/build_847ed84c/WA2DC.go:89 +0xea
2020-12-24T13:55:52.687290+00:00 heroku[worker.1]: Process exited with status 2
2020-12-24T13:55:52.743424+00:00 heroku[worker.1]: State changed from up to crashed

Merry Christmas!

Linux Support

Hi,
this is a nice and usefull project but i wish it will run at Linux for Example at Raspberry OS at Raspberry Pi.
thx

Log file has 310 GB in a day

There's nothing much to say. Yesterday I installed the bot on my Discord server, for me and my friends, whitelisted only one chat and kept it there in the background. I wake up today with my drive full...

WA2DC runs setup every time

I'm trying to get it on my raspberry pi but I can't get it to work at all. It always says "this is your first run".

Crashes

goroutine 3708 [running]:
log.Panicln(0xc0000b9e00, 0x1, 0x1)
        log/log.go:365 +0xb7
main.handlePanic(...)
        command-line-arguments/WA2DC.go:730
main.waSendMessage(0xc000251240, 0x1b, 0xc000006120)
        command-line-arguments/WA2DC.go:418 +0x34a
main.dcOnMessageCreate(0xc0000d6b40, 0xc000006120)
        command-line-arguments/WA2DC.go:230 +0x191
github.com/bwmarrin/discordgo.messageCreateEventHandler.Handle(0xcae8b8, 0xc0000d6b40, 0xc04400, 0xc000006120)
        github.com/bwmarrin/[email protected]/eventhandlers.go:497 +0x52
created by github.com/bwmarrin/discordgo.(*Session).handle
        github.com/bwmarrin/[email protected]/event.go:171 +0x118
Bot is now running. Press CTRL-C to exit.
panic: sending message timed out


goroutine 2230 [running]:
log.Panicln(0xc000125e00, 0x1, 0x1)
        log/log.go:365 +0xb7
main.handlePanic(...)
        command-line-arguments/WA2DC.go:730
main.waSendMessage(0xc0000541a0, 0x1b, 0xc0000ce028)
        command-line-arguments/WA2DC.go:418 +0x34a
main.dcOnMessageCreate(0xc0000dab40, 0xc0000ce028)
        command-line-arguments/WA2DC.go:230 +0x191
github.com/bwmarrin/discordgo.messageCreateEventHandler.Handle(0xcae8b8, 0xc0000dab40, 0xc04400, 0xc0000ce028)
        github.com/bwmarrin/[email protected]/eventhandlers.go:497 +0x52
created by github.com/bwmarrin/discordgo.(*Session).handle
        github.com/bwmarrin/[email protected]/event.go:171 +0x118
Bot is now running. Press CTRL-C to exit.

Don't really know what this is but it makes the script crash. Hopefully you can figure it out

bot token

when i put the bot token in the exe it doesn't do anything

tweak nr 2

Please make it, so that 1st, nicknames can be also displayed(I got blamed bc in the whatsapp group was the message [SmallPP] thx)

And an other thing, bc im using my main whatsapp account for the bridge, my message dont appear, maybe you could tweak it a bit, so that there is a setting, that only when a message with "[" starts, it will be send! That way, my message will appear, and there will be NO infinty loop

Bot appearing offline on Discord

I just added this bot to a server. It was working perfectly, but after few minutes the bot is appearnig offline. My Whatsapp is online and I dont know what to do.

image

Better Documentation Needed

I followed the installation instructions to get it installed and added to my server but the bot keeps jumping from being online to offline, does not respond to any commands and I have no idea how to connect it to Whatsapp web. Please provide better instructions on how to do this.

Media (Pictures and Files) Dont work in new Update

Hello, again I just fund since in the updated dependencies all the media stop work like it was working before like you send a Picture into Discord to Whatsapp now only show the link not the actual photo like before.
Audio seems to work fine Files, and Pictures are only the issue.
I think I see the example on go-whatsapp there is some validation now to receive both types of files
I don't now exactly.

I'm complete new on Golang.

Thanks for this awesome bot again.

Dependencies are outdated

I'm having a lot of problems to even make it to work most of the times. I got this problem
Timed out. Please rescan QR Code. error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}

But is a bit strange sometimes works fine without any issue.

I'm not sure why this happens at all.

Hope you can help me.

Have a nice day!

Remember category for chats

This is not an issue, it's more of an idea.
The thing is, I create the chat and whitelist it, and then I wanna move it to a different category, and that works fine, no problem, it still works in that category. But if I close the program and reopen it, it will look for the chat inside the default category and doesn't find it, so it creates another one.
You could make it remember the category for each individual chat, or make the program search the entire server. It would be perfect.
Thanks in advance for the attention.

sends messages for muted groups also

I am added to almost 100 groups. I receive like 1k msgs every day. I don't want notifications for all of them on discord 😬. Want blacklist feature as well🙏

The bot crashes abruptly

exactly as the title mentioned,
i use my own laptop to keep the bot running (ofc using the exe that you compiled)
when i leave my laptop for a while, suddenly i see that the program itself is gone, and i have to reopen it again
any tips / suggestions ?

what is the step after install

so i followd the totourial and stuff and the bot sent me a qr code that I scanned with Whatsapp web thing, it didn't work....?

Ideas

First of all, thanks for all your hard work. You always try to work on my ideas and fix stuff as fast as you can.

So, I have some ideas. I know you're a busy guy, I've seen your answer to that other guy, but I don't know how to code in GO, so for now I'll leave these suggestions to you, and you can try to do it IF you want WHEN you want.

  1. Simplify the whitelist commands, with something like this:
  • whitelist add;
  • whitelist remove;
  • whitelist list.
    Instead of one individual command for each.
  1. Add a help command;

  2. Implement the message text (if there is any) when images are sent (as of now the images are shown without the message text);

  3. Implement replies. Something like:
    if (the message is a reply to another message) then
    embed this other message text in the current message;

  4. Implement sticker support (as of now stickers are not shown);

  5. Implement mentions with the @ symbol (this one I imagine it will be harder than the others to implement, if it's even possible).

That's it. With these implementations the bot would be perfect.

WA2DC.exe crashes on startup.

I did everything the tutorial said and it let me scan a QR code but it crashes now every time I start up the program.

A few Bugs (Messages Sending statuses)

So i downloaded this and it works amazing man!!! thank you so much for this project
i notice a few bugs that i will be really happy if you fix

  • Attachments are not being sent as files/images
    (when you send it from discord the user on whatsapp will see the link for the file/image)

  • Whatsapp & Discord Stickers are not being sent (depends on the client side)
    sending from whatsapp to discord: Not sending at all
    sending from discord to whatsapp: Shows Empty message

no conect

congratulate you because your app is great.

In the title I was wrong because if it connects, just don't let this app die, because it's great.

Bot crashes when sending file without a message in Whatsapp

Whenever a picture or a file containing no additional message is sent in whatsapp the bot crashes:

panic: HTTP 400 Bad Request, {"message": "Cannot send an empty message", "code": 50006}

goroutine 55 [running]:
main.handleMediaMessage(0xc0001fc600, 0x14, 0xc0001fc5e0, 0x1b, 0x0, 0x0, 0x0, 0x5f2134e2, 0x0, 0x0, ...)
command-line-arguments/WA2DC.go:338 +0x2e0
main.waHandler.HandleDocumentMessage(0xc0001fc600, 0x14, 0xc0001fc5e0, 0x1b, 0x0, 0x0, 0x0, 0x5f2134e2, 0x0, 0x0, ...)
command-line-arguments/WA2DC.go:372 +0x121
created by github.com/Rhymen/go-whatsapp.(*Conn).handleWithCustomHandlers
github.com/Rhymen/[email protected]/handler.go:242 +0xdb1

While I understand the bot doesn't send pictures or files, maybe it should at least not crash at this event or send a message saying [file]

Use only one chat

I'd like to know if it is possible to only use one chat. I'm running a small D&D Server with a few friends and discord is very bad at notifying everyone if a channel is updated. I'd like to use this Bot to to send quick notifications in our whatsapp Group from discord whenever I updated something. Is it possible to only use one chat without the others popping up?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.