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

fix!: typos in API naming #2212

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions docs/getting-started/creating-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ wppconnect.create({
console.log('urlCode (data-ref): ', urlCode);
},
statusFind: (statusSession, session) => {
console.log('Status Session: ', statusSession); //return isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || desconnectedMobile || deleteToken
console.log('Status Session: ', statusSession); //return isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || disconnectedMobile || deleteToken
//Create session wss return "serverClose" case server for close
console.log('Session name: ', session);
},
Expand Down Expand Up @@ -87,7 +87,7 @@ More details in {@link StatusFind}
| `qrReadSuccess` | If the user is not logged in, the QR code is passed on the terminal a callback is returned. After the correct reading by cell phone this parameter is returned |
| `qrReadFail` | If the browser stops when the QR code scan is in progress, this parameter is returned |
| `autocloseCalled` | The browser was closed using the autoClose command |
| `desconnectedMobile` | Client has disconnected in to mobile |
| `disconnectedMobile` | Client has disconnected to the mobile device |
| `serverClose` | Client has disconnected in to wss |
| `deleteToken` | If you pass true within the function `client.getSessionTokenBrowser(true)` |

Expand All @@ -97,7 +97,7 @@ wppconnect
.create({
session: 'sessionName',
statusFind: (statusSession, session) => {
// return: isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || desconnectedMobile || deleteToken
// return: isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || disconnectedMobile || deleteToken
console.log('Status Session: ', statusSession);
// create session wss return "serverClose" case server for close
console.log('Session name: ', session);
Expand Down
2 changes: 1 addition & 1 deletion examples/rest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async function startWPP (){
catchQR: (base64Qr, asciiQR, attempts, urlCode) => {
},
statusFind: (statusSession, session) => {
console.log('Status Session: ', statusSession); //return isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || desconnectedMobile || deleteToken
console.log('Status Session: ', statusSession); //return isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || disconnectedMobile || deleteToken
//Create session wss return "serverClose" case server for close
console.log('Session name: ', session);
},
Expand Down
16 changes: 8 additions & 8 deletions src/api/layers/sender.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ export class SenderLayer extends ListenerLayer {
}

/**
* Sets a audio or image view once. Marks message as played
* Sets an audio or image view once. Marks message as played
* @category Chat
* @param msgId Message id: [email protected]
*/
Expand All @@ -1107,7 +1107,7 @@ export class SenderLayer extends ListenerLayer {
* ```
* @category Chat
* @param to Chat Id
* @param duration Duration um miliseconds
* @param duration Duration um milliseconds
*/
public async startTyping(to: string, duration?: number) {
return evaluateAndReturn(
Expand Down Expand Up @@ -1135,15 +1135,15 @@ export class SenderLayer extends ListenerLayer {
* Starts recording ('Recording...' state)
* @example
* ```javascript
* // Keep sending recording state, use stopRecoring to finish
* // Keep sending recording state, use `stopRecording` to finish
* await client.startRecording('[number]@c.us');
*
* // Keep sending typing state for 5 seconds
* await client.startRecording('[number]@c.us', 5000);
* ```
* @category Chat
* @param to Chat Id
* @param duration Duration um miliseconds
* @param duration Duration um milliseconds
*/
public async startRecording(to: string, duration?: number) {
return evaluateAndReturn(
Expand All @@ -1161,7 +1161,7 @@ export class SenderLayer extends ListenerLayer {
* @category Chat
* @param to Chat Id
*/
public async stopRecoring(to: string) {
public async stopRecording(to: string) {
return evaluateAndReturn(this.page, ({ to }) => WPP.chat.markIsPaused(to), {
to,
});
Expand Down Expand Up @@ -1346,7 +1346,7 @@ export class SenderLayer extends ListenerLayer {
* ```
* @category Chat
* @param to Chat Id
* @param duration Duration um miliseconds
* @param duration Duration um milliseconds
*/
public async sendReactionToMessage(msgId: string, reaction: string | false) {
return evaluateAndReturn(
Expand All @@ -1360,12 +1360,12 @@ export class SenderLayer extends ListenerLayer {
}

/**
* Send a order message
* Send an order message
* To send (prices, tax, shipping or discount), for example: USD 12.90, send them without dots or commas, like: 12900
*
* @example
* ```javascript
* // Send Order with a product
* // Send an order with a product
* client.sendOrderMessage('[number]@c.us', [
* { type: 'product', id: '67689897878', qnt: 2 },
* { type: 'product', id: '37878774457', qnt: 1 },
Expand Down
2 changes: 1 addition & 1 deletion src/api/model/enum/group-notification-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

export enum GroupNotificationType {
Add = 'add',
Inivite = 'invite',
Invite = 'invite',
Remove = 'remove',
Leave = 'leave',
Subject = 'subject',
Expand Down
4 changes: 2 additions & 2 deletions src/api/model/enum/status-find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export enum StatusFind {
*/
browserClose = 'browserClose',
/**
* Client has disconnected in to mobile.
* Client has disconnected to the mobile device.
*/
desconnectedMobile = 'desconnectedMobile',
disconnectedMobile = 'disconnectedMobile',
/**
* Client is ready to send and receive messages.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/api/whatsapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Whatsapp extends BusinessLayer {
setTimeout(async () => {
if (this.statusFind) {
try {
this.statusFind('desconnectedMobile', session);
this.statusFind('disconnectedMobile', session);
} catch (error) {}
}
}, 1000);
Expand Down
Loading