Giter VIP home page Giter VIP logo

go-whatsapp's People

Contributors

almogbaku avatar artem-webdev avatar b-1000 avatar beshoo avatar brunoferreiras avatar carloslfu avatar code8525 avatar d6o avatar deewai avatar donovandiamond avatar fabianmendez avatar gabstv avatar herpiko avatar hoehermann avatar houstondapaz avatar ii64 avatar jeremia49 avatar joaopaulosr95 avatar jwm947 avatar kaxap avatar krombel avatar punneetmehta avatar rhsobr avatar rhymen avatar romerito007 avatar schultemk avatar sthales avatar tulir avatar x00b avatar yg0x01 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  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

go-whatsapp's Issues

Check sent message status

Hey great work on this package! Thank you and please keep it up!

Can you tell how I can check if the message I sent was
(a) delivered(2 ticks) to the receiver
(b) read(blue ticks) by the receiver

Receive and echo example

I'm not go developer,
can you please create example echo-ing message received.
Receive and send the same message to sender.

something like

func (*waHandler) HandleTextMessage(message whatsapp.TextMessage) {
    if strings.Contains(strings.ToLower(message.Text), "hello") {
        msg := whatsapp.TextMessage{
            Info: whatsapp.MessageInfo{
                RemoteJid: message.Info.RemoteJid,
            },
            Text: message.Text
        }
        wac.Send(msg)
    }
    fmt.Printf("%v %v\n\t%v\n", message.Info.Timestamp, message.Info.RemoteJid, message.Text)
}

Easy way to get chat history as TextMessage/ImageMessage/…

I want to create a tool to export a chat. Getting the chat history with LoadMessages works fine. The problem is, that it returns *proto.WebMessageInfo (in Node.Content) that has to be parsed with parseProtoMessage which isn’t exported. It is possible to parse it manually, but it is too complex considering that such a function already exists.

Am I missing an easy way to get TextMessages, ImageMessages, etc… via LoadMessages?

Do you think exporting parseProtoMessage is an option? I implemented this as a workaround and it seems to work well.

VCard

Hi, it is possible to send vcard

Send Audio

How to send an audio? what is the mimetype? and else..

Remove conversation

Hello,
your api works like a charm, but we would love to remove old conversation after some time.
Is it possible from this api?

Thanks!

Name/Username of RemoteJID

Is there a way I can retrieve the name of the RemoteJID?

I wanted to see the registered name or even just the username of the person who sent me a message.

The Python version of this i think have one and it also just listens to the web socket of whatsapp that's why I am wondering where I can get the name or even just the username?

Login Without Scanning QR Code

Hello I have a problem.

go-whatsapp doesn't have a response/listen when the device used to scan the QR code have no internet access

I have discuss this to the other programmer that made our system before using yowsup (https://github.com/tgalal/yowsup) and that yowsup have their own registration and device for the authentication for whatsapp

Point: it is possible to connect to whatsapp web without scanning the QR code

Issue: I wanted to do that also. spawn an emulator then use that android emulator credentials to register to whatsapp then use that emulator to login to whatsapp wihout scanning the QR code

Requirements: This should all happen only in our linux server

Message sent successfully, return error.

error sending message: error decoding sending response: unexpected end of JSON input
Problem only occurs with Mac OS X, would you have an idea why this happens?
I'm not an expert on GO.
It started after the last commit.

GroupMetaData

Hey,
I would like to query the group information.

I use the GroupMetaData function. But i only recive a hex code like 0xc04467b260
But should I not receive something like that? sigalor/whatsapp-web-reveng#73

Thats my code:

		groupMeta, err := wa.GetGroupMetaData(message.Info.RemoteJid)
		if (err != nil){
			fmt.Println("ERROR! %v", err)
		}
		fmt.Println(groupMeta)

p.s. Good work!

When can we expect sending messages?

I've seen in another repo that figured out sending messages, presumably through this wrapper? And am wondering when that code will be available.

It doesn't need to be very polished I would just like to see how you implemented it.

Cannot send images

Hello, i cannot send images as used in example. Worked before. Now image is sent, but it cannot be opened within WhatsApp in phone. It stucks app when i click on the photo, there is also no thumbnail.

Could you update examples for images/file sending?

Thanks a lot for your great work!

EDIT: Tried exactly your code from examples and it works, probably fault in my code, sorry for opening invalid ticket, please close it.

Message read

Is it available to determine, if message was read by end-user?
Could you please provide handler example? Thanks!

Exiting application

Hello,

I put the application to run, but after a while it automatically exits.
Is it a bug?

Receive only new messages

Hi, first of all, thank you for this great work

I wonder if is there any way to receive only the new messages when I restore the session

stop method

great work
I did not find any method for stopping connection and running gorutins like:
go wac.readPump ()
go wac.writePump ()
go wac.keepAlive (20000, 90000)
I just wrapped the bot in the web interface that the bot activates. And I want to turn it off without closing the whole application. I wanted to close using the context.WithCancel but this is not enough

And... Does whatsapp ban a bots?

Hi, issue with get contacts

I also used the function of Contacts(), and it looks like when you tries to populate the store with contacts, the code panics with the following stack:
I tried to understand the cause, and it looks like on the conn.go file line 242, you assume the the msg has at least length of 32 bytes, but I added few print outs, and the msg is empty in some cases (with len of 0)
Any idea how to fix this issue?

echo: http: panic serving [::1]:61067: runtime error: slice bounds out of range
goroutine 34 [running]:
net/http.(*conn).serve.func1(0xc0421920a0)
C:/Go/src/net/http/server.go:1726 +0xd7
panic(0x881be0, 0xb9f680)
C:/Go/src/runtime/panic.go:502 +0x237
github.com/Rhymen/go-whatsapp.(*Conn).decryptBinaryMessage(0xc04219a1c0, 0xbcba08, 0x0, 0x0, 0x0, 0x0, 0x800a)
C:/workspaces/src/github.com/Rhymen/go-whatsapp/conn.go:242 +0x3d2
github.com/Rhymen/go-whatsapp.(*Conn).query(0xc04219a1c0, 0x90e2a3, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
C:/workspaces/src/github.com/Rhymen/go-whatsapp/contact.go:155 +0x40c
github.com/Rhymen/go-whatsapp.(*Conn).Contacts(0xc04219a1c0, 0x0, 0x0, 0xbcba08)
C:/workspaces/src/github.com/Rhymen/go-whatsapp/contact.go:103 +0x7d
myproject/server/business/whats.(*waSession).GetContacts(0xc042055c18, 0x0, 0x0, 0x8e8bc0, 0x0, 0x0)
C:/workspaces/src/myproject/server/business/whats/session.go:79 +0x83
myproject/server/rest.whatsAppContacts(0x970640, 0xc04219a150, 0xc04219a000, 0xc0421621e0)

how get group name?

groupMeta, err := wac.GetGroupMetaData(id)
if err != nil {
fmt.Println("ERROR! %v", err)
}
fmt.Println(<-groupMeta)

result
{"status":400}

how to get group name?

GetPushName

Hello, is it possible to get the PushName of the contact?

Read Receipts

Hello, Can We check wether our message is already read by the recepients ?

Check if number has WhatsApp

Hi,
is it possible to check whether number has WhatsApp or not?

Because right now, I can send message to non existing numbers, which leads to fail of mobile application when you click on wrong number conversation on your phone.

Thanks a lot!

Where are these constants used?

go-whatsapp/conn.go

Lines 19 to 59 in 1c2b085

const (
debugLog metric = iota + 1
queryResume
queryReceipt
queryMedia
queryChat
queryContacts
queryMessages
presence
presenceSubscribe
group
read
chat
received
pic
status
message
queryActions
block
queryGroup
queryPreview
queryEmoji
queryMessageInfo
spam
querySearch
queryIdentity
queryUrl
profile
contact
queryVcard
queryStatus
queryStatusUpdate
privacyStatus
queryLiveLocations
liveLocation
queryVname
queryLabels
call
queryCall
queryQuickReplies
)

Update Contacts when send message

How do I call the updateContacts function in my code. I need get client's name when send message as soon as I start a conversation.

Rhymen - Paid freelance job to implement a sendMessage in the whatsapp-web-reveng project

@Rhymen I didn't find your e-mail, so trying to contact by here :)

Since you managed to create an implementation of whatsapp-web-reveng from scratch in Go, you have the knowledge to do the 2 adjustments that we need.

We need an easy way to send and receive messages in the JS code of the base project, basically what you did in your examples/sendTextMessages implementation, which works perfectly.

  1. A callback when receiving a message, in the JS server. Example: onMessageReceived(function(payload) {
    .... our custom code here
    })

payload contains the received message, the sender JID, the timestamp and the message JID/ID.

  1. An easy way to send a message back to the contact. Basically you will wrap in a JS function all the current hard steps involved in sending a message. This function will basically communicate with the Python backend of the whatsapp-web-reveng, which involves hashing/cryptographing the content, etc. What we want is a simple sendMessage function that wraps and does all the work.

Example: sendMessage(payload).

Are you available for freelance work to do that? If so, please contact me at [email protected] (this is a work to be integrated in our platform https://fredbots.com).

info["is24h"] is nil

As it seems, the session info field named 'Is24h' may be empty, so a safer conversion should be used instead of the current info["is24h"].(bool) (in session.go, line 78).

panic: interface conversion: interface {} is nil, not bool

goroutine 1 [running]:
github.com/Rhymen/go-whatsapp.newInfoFromReq(0xc0421140f0, 0xc042114180)
	C:/Workspace/GoProjects/WhatsAppWeb/src/github.com/Rhymen/go-whatsapp/session.go:78 +0xa7c
github.com/Rhymen/go-whatsapp.(*Conn).RestoreSession(0xc0420da070, 0xc042102380, 0x18, 0xc04210e2a0, 0x2c, 0xc042014240, 0x52, 0xc0421023a0, 0x20, 0x20, ...)
	C:/Workspace/GoProjects/WhatsAppWeb/src/github.com/Rhymen/go-whatsapp/session.go:319 +0x15d0
github.com/Rhymen/go-whatsapp/automation/infra.Login(0xc0420da070, 0xc04213a080, 0x40, 0x40, 0x0)
	C:/Workspace/GoProjects/WhatsAppWeb/src/github.com/Rhymen/go-whatsapp/automation/infra/login.go:16 +0x37c
main.main()
	C:/Workspace/GoProjects/WhatsAppWeb/src/github.com/rhymen/go-whatsapp/automation/automation.go:113 +0x422

ProtoVersion 17 being banned

Hey guys, I was testing the api, and it works like charm, but for some cases, the number is banned right after reading the qr code.

What i investigated is the following:
for newly created whatsapp accounts, the received protoversion in CONN is 17 and when you read the qr code you are banned maybe because we are talking in an old protobuff version.

I tried with a previous number that i had and the protoversion in this case is 15 and the api works like a charm.

do you guys have any ideia about this? have you ever faced something similar?

Tick Blue

How send message ["Presence",{"id":"[email protected]","type":"available"}] in my code?? For the user to see that I read the message.

SubscribePresence() not working for all contacts

I've been trying to investigate this issue for a while now, and I can't figure it out. Maybe you can find a solution for this issue...
I have 3 devices: A, B and C.
I have connected the go-whatsapp to device A, and in it i called SubscribePresence() for both B and C.
However, I only get presence updates for B, and no updates at all for C.
Moreover, if I turn the screen on the mobile A on and go into the chat with C (seeing the "Last seen" at the top) - from that point I start getting presence updates for C on go-whatsapp.
I suspect that SubscribePresence() is not enough for getting a device's presence updates and maybe another thing should be called to make it happen.. something that the actual WhatsApp application calls or that the actual WhatsApp Web calls and is missing here in go-whatsapp.
As a lead, I think that only when we get the "Last seen" working, it will finally be solved..
Another lead, C was never saved as a contact on device A (that means that I see its number in the chat list).
(B was once saved as a contact on device A but in order to check if having a device saved as a contact is necessary for the presence updates, I deleted B from device A.. and it still works)
I will appreciate your help.
Thanks.

Image with text

Hello dear developper !

When receiving images with text, how to get the text message?

If it is not already developped, how could I contribute?

Thanks you to share this with the world !
Jehon

Open multi sessions

Is it possible to open more than one session?

The idea is, each session has an id. When the app try to restore the session, I give this id and this specific session will be restored.

Sending files?

All respect to your work, your projects work like a charm and sending messages is ultra fast, which is not I can tell about my "stupid selenium solution".

Are you willing to implement file sending feature?

Thanks for your work!

Message timed out

I try this go-whatsapp, its always showing message timed out.

Althought sometimes the message delivered.
I've tried both on linux (centos 7) and windows, in average the connection timeout always occured.

When I'm increasing 5 to 50
wac, err := whatsapp.newConn(5 * time.Second)

The timeout error gone, but the sending process are too slow.

How do I retrieve message ID that is sent

Currently the Send method is implemented sort of in a fire and forget way. I'm not sure how to get the message ID of a sent message. Messages sent are not echoed back either.

Timeout on sending message

This snippet is sending the message correctly, but it does not return success.


	msg := whatsapp.TextMessage{
		Info: whatsapp.MessageInfo{
			RemoteJid: "[email protected]",
		},
		Text: "testing...",
	}

	err = wac.Send(msg)

The error:

error sending message: sending message timed out

The script is examples/sendTextMessages/main.go

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.