Capture device battery status in MD
Is there an existing issue for this?
- [X] I have searched the existing issues
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like.
Be able to capture the current battery status of the phone device.
Describe an alternate solution.
No response
Additional context
No response
To get current battery percentage and charging status for the attached device on demand, use the method getBatteryStatus()
Learn more: https://docs.wwebjs.dev/ClientInfo.html#getBatteryStatus
To subscribe to events emitted when the battery percentage for the attached device changes, listen to the event change_battery. Will not be sent if using multi-device.
Learn more: https://docs.wwebjs.dev/Client.html#event:change_battery
It is possible to do this in multi-device, but it is super inaccurate that I wouldn't bother. If the phone is offline etc. the state of the battery is not streamed. Will keep open & in mind for later though