mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Change profile status for yourself (#1796)
* Update README.md * Update chats.ts * Update chats.ts
This commit is contained in:
@@ -688,6 +688,11 @@ await sock.sendMessage(
|
|||||||
const status = await sock.fetchStatus("xyz@s.whatsapp.net")
|
const status = await sock.fetchStatus("xyz@s.whatsapp.net")
|
||||||
console.log("status: " + status)
|
console.log("status: " + status)
|
||||||
```
|
```
|
||||||
|
- To change your profile status
|
||||||
|
``` ts
|
||||||
|
const status = 'Hello World!'
|
||||||
|
await sock.updateProfileStatus(status)
|
||||||
|
```
|
||||||
- To get the display picture of some person/group
|
- To get the display picture of some person/group
|
||||||
``` ts
|
``` ts
|
||||||
// for low res picture
|
// for low res picture
|
||||||
|
|||||||
@@ -175,6 +175,25 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** update the profile status for yourself */
|
||||||
|
const updateProfileStatus = async(status: string) => {
|
||||||
|
await query({
|
||||||
|
tag: 'iq',
|
||||||
|
attrs: {
|
||||||
|
to: S_WHATSAPP_NET,
|
||||||
|
type: 'set',
|
||||||
|
xmlns: 'status'
|
||||||
|
},
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
tag: 'status',
|
||||||
|
attrs: { },
|
||||||
|
content: Buffer.from(status, 'utf-8')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const fetchBlocklist = async() => {
|
const fetchBlocklist = async() => {
|
||||||
const result = await query({
|
const result = await query({
|
||||||
tag: 'iq',
|
tag: 'iq',
|
||||||
@@ -770,6 +789,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
fetchBlocklist,
|
fetchBlocklist,
|
||||||
fetchStatus,
|
fetchStatus,
|
||||||
updateProfilePicture,
|
updateProfilePicture,
|
||||||
|
updateProfileStatus,
|
||||||
updateBlockStatus,
|
updateBlockStatus,
|
||||||
getBusinessProfile,
|
getBusinessProfile,
|
||||||
resyncAppState,
|
resyncAppState,
|
||||||
|
|||||||
Reference in New Issue
Block a user