Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WaHa Pro - Show always online? #121

Closed
Jolloniego opened this issue Jun 22, 2023 · 3 comments
Closed

WaHa Pro - Show always online? #121

Jolloniego opened this issue Jun 22, 2023 · 3 comments
Labels
enhancement New feature or request waha:PLUS Relates to WAHA Plus version

Comments

@Jolloniego
Copy link

Is there a way to set a waha bot to always appear online?

Could not find it in the docs.

@allburov
Copy link
Contributor

Hi! Right now it's not possible, but we'll look at this!

@allburov allburov added enhancement New feature or request waha:PLUS Relates to WAHA Plus version labels Jun 23, 2023
@allburov
Copy link
Contributor

Hi! There's a new endpoint in the latest WAHA Plus version 2023.7.12, we'll add it in the next release in WAHA Core.

To set your status as "online", you send a POST /api/<session>/presence request with the body:

{
  "presence": "online"
}

I haven't tested how often you should send it, usually state works for about 10-25 seconds, after that time you'll probably have to send another request for that.

Keep in mind that being always online will turn off your push notifications from the device #28


Presence

Possible presence statuses that you can set or get for chats:

  • online
  • offline
  • typing
  • recording
  • paused resets the chat presence after you were typing

Endpoints

Set presence

You can set your global or chat-related presence with POST /api/{session}/presence endpoint

Start typing to a chat (you can use POST /startTyping instead)

{
  "chatId": "111111111@c.us",
  "presence": "typing"
}

Clear "typing" state (you can use POST /stopTyping instead)

{
  "chatId": "111111111@c.us",
  "presence": "paused"
}

Set global "online", all contacts will see it

{
  "presence": "online"
}

💡 In the multi-device version of WhatsApp - if a desktop client is active, WhatsApp doesn't send push notifications
to the device.
If you would like to receive said notifications - you need to mark a session's presence as offline.

{
  "presence": "offline"
}

@Jolloniego
Copy link
Author

Thank you @allburov!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waha:PLUS Relates to WAHA Plus version
Projects
None yet
Development

No branches or pull requests

2 participants