mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
feat: Set client's display name (pushname)
This commit is contained in:
6
index.d.ts
vendored
6
index.d.ts
vendored
@@ -84,6 +84,12 @@ declare namespace WAWebJS {
|
||||
*/
|
||||
setStatus(status: string): Promise<void>
|
||||
|
||||
/**
|
||||
* Sets the current user's display name
|
||||
* @param displayName New display name
|
||||
*/
|
||||
setDisplayName(displayName: string): Promise<void>
|
||||
|
||||
/** Changes and returns the archive state of the Chat */
|
||||
unarchiveChat(chatId: string): Promise<boolean>
|
||||
|
||||
|
||||
@@ -556,6 +556,17 @@ class Client extends EventEmitter {
|
||||
}, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current user's display name.
|
||||
* This is the name shown to WhatsApp users that have not added you as a contact beside your number in groups and in your profile.
|
||||
* @param {string} displayName New display name
|
||||
*/
|
||||
async setDisplayName(displayName) {
|
||||
await this.pupPage.evaluate(async displayName => {
|
||||
return await window.Store.Wap.setPushname(displayName);
|
||||
}, displayName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current connection state for the client
|
||||
* @returns {WAState}
|
||||
|
||||
Reference in New Issue
Block a user